Class: Klient::ResourceCollection
- Inherits:
-
Object
- Object
- Klient::ResourceCollection
- Defined in:
- lib/klient/resource_collection.rb
Instance Attribute Summary collapse
-
#last_response ⇒ Object
readonly
Returns the value of attribute last_response.
-
#members ⇒ Object
readonly
Returns the value of attribute members.
Instance Method Summary collapse
-
#initialize(arr) ⇒ ResourceCollection
constructor
A new instance of ResourceCollection.
- #method_missing(mth, *args, &block) ⇒ Object
- #respond_to?(mth, *args, &block) ⇒ Boolean
Constructor Details
#initialize(arr) ⇒ ResourceCollection
Returns a new instance of ResourceCollection.
5 6 7 |
# File 'lib/klient/resource_collection.rb', line 5 def initialize(arr) @members = arr end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(mth, *args, &block) ⇒ Object
9 10 11 |
# File 'lib/klient/resource_collection.rb', line 9 def method_missing(mth, *args, &block) @members.send(mth, *args, &block) end |
Instance Attribute Details
#last_response ⇒ Object (readonly)
Returns the value of attribute last_response.
3 4 5 |
# File 'lib/klient/resource_collection.rb', line 3 def last_response @last_response end |
#members ⇒ Object (readonly)
Returns the value of attribute members.
3 4 5 |
# File 'lib/klient/resource_collection.rb', line 3 def members @members end |
Instance Method Details
#respond_to?(mth, *args, &block) ⇒ Boolean
13 14 15 |
# File 'lib/klient/resource_collection.rb', line 13 def respond_to?(mth, *args, &block) super || @members.respond_to?(mth) end |