Class: SevenApi::Client
- Inherits:
-
Object
- Object
- SevenApi::Client
- Defined in:
- lib/seven_api/client.rb
Instance Method Summary collapse
-
#initialize(resource) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(resource) ⇒ Client
Returns a new instance of Client.
22 23 24 25 26 27 28 29 30 |
# File 'lib/seven_api/client.rb', line 22 def initialize(resource) SevenApi::Util::get_namespace_classes(SevenApi::Resources).each do |cls| name = cls.name.split('::').last instance_variable_set("@#{name}", cls.new(resource)) singleton_class.instance_eval("attr_reader :#{name}") end end |