Class: DaashubAPI::Base
- Inherits:
-
Object
- Object
- DaashubAPI::Base
- Defined in:
- lib/daashub_api/base.rb
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(args = {}) ⇒ Base
Returns a new instance of Base.
3 4 5 6 |
# File 'lib/daashub_api/base.rb', line 3 def initialize(args = {}) @attributes = {} args.each { |k, v| @attributes[k.to_sym] = v } end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *argv, &block) ⇒ Object (protected)
10 11 12 13 |
# File 'lib/daashub_api/base.rb', line 10 def method_missing(name, *argv, &block) super unless @attributes.key?(name) @attributes[name] end |