Class: DaashubAPI::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/daashub_api/base.rb

Direct Known Subclasses

Account, BatchFile, Company, History, Query

Instance Method Summary collapse

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