Class: EchoCraft::ServiceObject
- Defined in:
- lib/echo_craft/service_object.rb
Overview
Basic Response to Service Objects
Direct Known Subclasses
EchoCraft::ServiceObjects::Create, EchoCraft::ServiceObjects::Destroy, EchoCraft::ServiceObjects::Query, EchoCraft::ServiceObjects::Update
Instance Attribute Summary collapse
-
#record ⇒ Object
Returns the value of attribute record.
-
#successful ⇒ Object
Returns the value of attribute successful.
Attributes inherited from Response
Instance Method Summary collapse
-
#initialize ⇒ ServiceObject
constructor
A new instance of ServiceObject.
- #set_service_successful ⇒ Object
- #unprocessabled ⇒ Object
Methods inherited from Response
Constructor Details
#initialize ⇒ ServiceObject
9 10 11 12 13 14 |
# File 'lib/echo_craft/service_object.rb', line 9 def initialize super @record = nil @successful = false @status = change_status(:accepted) end |
Instance Attribute Details
#record ⇒ Object
Returns the value of attribute record.
7 8 9 |
# File 'lib/echo_craft/service_object.rb', line 7 def record @record end |
#successful ⇒ Object
Returns the value of attribute successful.
7 8 9 |
# File 'lib/echo_craft/service_object.rb', line 7 def successful @successful end |
Instance Method Details
#set_service_successful ⇒ Object
16 17 18 |
# File 'lib/echo_craft/service_object.rb', line 16 def set_service_successful @successful = true end |
#unprocessabled ⇒ Object
20 21 22 |
# File 'lib/echo_craft/service_object.rb', line 20 def unprocessabled change_status(:unprocessable_entity) end |