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.



3
4
5
6
# File 'lib/dhis2/collection_wrapper.rb', line 3

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



8
9
10
11
# File 'lib/dhis2/collection_wrapper.rb', line 8

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