class Github::API

def self.namespace(*names)

Other tags:
    Api: - public

Returns:
  • (self) -

Parameters:
  • names (Array[Symbol]) --
def self.namespace(*names)
  options = names.last.is_a?(Hash) ? names.pop : {}
  names   = names.map(&:to_sym)
  name    = names.pop
  if public_method_defined?(name)
    raise ArgumentError, "namespace '#{name}' is already defined"
  end
  class_name = extract_class_name(name, options)
  define_method(name) do |*args, &block|
    options = args.last.is_a?(Hash) ? args.pop : {}
    API::Factory.new(class_name, current_options.merge(options), &block)
  end
end