Class: LockstepSdk::ActionResultModel
- Inherits:
-
Object
- Object
- LockstepSdk::ActionResultModel
- Defined in:
- lib/lockstep_sdk/models/action_result_model.rb
Overview
Represents the result of an action.
In the Lockstep API, an Action is returned when an API call does not produce any data but does produce messages that can be useful in understanding what work was performed. You may use the messages text to display user visible error messages or the results of various operations.
Instance Attribute Summary collapse
-
#messages ⇒ String
If the API call produced messages, this element will contain a list of user-visible text strings that contain information about what work occurred in the API.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ ActionResultModel
constructor
Initialize the ActionResultModel using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
Constructor Details
#initialize(params = {}) ⇒ ActionResultModel
Initialize the ActionResultModel using the provided prototype
30 31 32 |
# File 'lib/lockstep_sdk/models/action_result_model.rb', line 30 def initialize(params = {}) @messages = params.dig(:messages) end |
Instance Attribute Details
#messages ⇒ String
Returns If the API call produced messages, this element will contain a list of user-visible text strings that contain information about what work occurred in the API.
36 37 38 |
# File 'lib/lockstep_sdk/models/action_result_model.rb', line 36 def @messages end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
40 41 42 43 44 |
# File 'lib/lockstep_sdk/models/action_result_model.rb', line 40 def as_json(={}) { 'messages' => @messages, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
48 49 50 |
# File 'lib/lockstep_sdk/models/action_result_model.rb', line 48 def to_json(*) "[#{as_json(*).to_json(*)}]" end |