Class: Ari::ListResource
- Inherits:
-
Object
- Object
- Ari::ListResource
- Defined in:
- lib/ari/list_resource.rb
Instance Method Summary collapse
-
#initialize(client, resource_klass) ⇒ ListResource
constructor
A new instance of ListResource.
Constructor Details
#initialize(client, resource_klass) ⇒ ListResource
Returns a new instance of ListResource.
4 5 6 7 |
# File 'lib/ari/list_resource.rb', line 4 def initialize(client, resource_klass) @client = client @resource_klass = resource_klass end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (private)
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/ari/list_resource.rb', line 11 def method_missing(method, *args, &block) if @resource_klass.respond_to? method = args.first ||= {} .merge!(client: @client) @resource_klass.send(method, , &block) else super end end |