Class: SmugMug::ApiCategory

Inherits:
Object
  • Object
show all
Defined in:
lib/smugmug/api_category.rb

Instance Method Summary collapse

Constructor Details

#initialize(http, category) ⇒ ApiCategory

Returns a new instance of ApiCategory.



3
4
5
# File 'lib/smugmug/api_category.rb', line 3

def initialize(http, category)
  @http, @category = http, category
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



7
8
9
10
# File 'lib/smugmug/api_category.rb', line 7

def method_missing(method, *args)
  return super unless SmugMug::API_METHODS[@category][method.to_s]
  @http.request("#{@category}.#{method}", args.pop || {})
end