Class: SmugMug::ApiCategory
- Inherits:
-
Object
- Object
- SmugMug::ApiCategory
- Defined in:
- lib/smugmug/api_category.rb
Instance Method Summary collapse
-
#initialize(http, category) ⇒ ApiCategory
constructor
A new instance of ApiCategory.
- #method_missing(method, *args) ⇒ Object
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 |