Class: Dhis2::CollectionWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/dhis2/collection_wrapper.rb

Instance Method Summary collapse

Constructor Details

#initialize(klass, client) ⇒ CollectionWrapper

Returns a new instance of CollectionWrapper.



5
6
7
8
# File 'lib/dhis2/collection_wrapper.rb', line 5

def initialize(klass, client)
  @klass  = klass
  @client = client
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



10
11
12
13
# File 'lib/dhis2/collection_wrapper.rb', line 10

def method_missing(method_name, *args, &block)
  args = args.unshift(@client)
  @klass.__send__(method_name, *args, &block)
end