Class: EchoCraft::ServiceObjects::Create
- Inherits:
-
EchoCraft::ServiceObject
- Object
- Response
- EchoCraft::ServiceObject
- EchoCraft::ServiceObjects::Create
- Defined in:
- lib/echo_craft/service_objects/create.rb
Overview
Basic Response to Create a Record on ServiceObject
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
Attributes inherited from EchoCraft::ServiceObject
Attributes inherited from Response
Instance Method Summary collapse
- #created(record) ⇒ Object
-
#initialize(params) ⇒ Create
constructor
A new instance of Create.
- #unprocessabled(record) ⇒ Object
Methods inherited from EchoCraft::ServiceObject
Methods inherited from Response
Constructor Details
#initialize(params) ⇒ Create
Returns a new instance of Create.
10 11 12 13 14 |
# File 'lib/echo_craft/service_objects/create.rb', line 10 def initialize(params) super() @record = nil @params = params end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
8 9 10 |
# File 'lib/echo_craft/service_objects/create.rb', line 8 def params @params end |
Instance Method Details
#created(record) ⇒ Object
16 17 18 19 20 |
# File 'lib/echo_craft/service_objects/create.rb', line 16 def created(record) @record = record change_status(:created) set_service_successful end |
#unprocessabled(record) ⇒ Object
22 23 24 25 |
# File 'lib/echo_craft/service_objects/create.rb', line 22 def unprocessabled(record) @record = record super() end |