Class: Dhis2::CollectionWrapper
- Inherits:
-
Object
- Object
- Dhis2::CollectionWrapper
- Defined in:
- lib/dhis2/collection_wrapper.rb
Instance Method Summary collapse
-
#initialize(klass, client) ⇒ CollectionWrapper
constructor
A new instance of CollectionWrapper.
- #method_missing(method_name, *args, &block) ⇒ Object
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 |