Class: Klient::ResourceCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/klient/resource_collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_responseObject (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

#membersObject (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

Returns:

  • (Boolean)


13
14
15
# File 'lib/klient/resource_collection.rb', line 13

def respond_to?(mth, *args, &block)
  super || @members.respond_to?(mth)
end