Class: Dryer::Clients::GeneratedClients::Create
- Inherits:
-
Services::SimpleService
- Object
- Services::SimpleService
- Dryer::Clients::GeneratedClients::Create
- Defined in:
- lib/dryer/clients/generated_clients/create.rb
Instance Attribute Summary collapse
-
#api_desc ⇒ Object
readonly
Returns the value of attribute api_desc.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(api_desc) ⇒ Create
constructor
A new instance of Create.
Constructor Details
#initialize(api_desc) ⇒ Create
Returns a new instance of Create.
7 8 9 |
# File 'lib/dryer/clients/generated_clients/create.rb', line 7 def initialize(api_desc) @api_desc = api_desc end |
Instance Attribute Details
#api_desc ⇒ Object (readonly)
Returns the value of attribute api_desc.
24 25 26 |
# File 'lib/dryer/clients/generated_clients/create.rb', line 24 def api_desc @api_desc end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/dryer/clients/generated_clients/create.rb', line 11 def call api_desc.inject(Class.new(GeneratedClient)) do |client, resource| resource_object = Resources::Create.call(resource) client.send( :define_method, ApiDescriptions::Resources::GenerateName.call(resource) ) do resource_object.new(self.base_url) end client end end |