Class: Logux::Response
- Inherits:
-
Object
- Object
- Logux::Response
- Defined in:
- lib/logux/response.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#custom_data ⇒ Object
readonly
Returns the value of attribute custom_data.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(status, action:, meta:, custom_data: nil) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(status, action:, meta:, custom_data: nil) ⇒ Response
Returns a new instance of Response.
7 8 9 10 11 12 |
# File 'lib/logux/response.rb', line 7 def initialize(status, action:, meta:, custom_data: nil) @status = status @action = action @meta = @custom_data = custom_data end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
5 6 7 |
# File 'lib/logux/response.rb', line 5 def action @action end |
#custom_data ⇒ Object (readonly)
Returns the value of attribute custom_data.
5 6 7 |
# File 'lib/logux/response.rb', line 5 def custom_data @custom_data end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
5 6 7 |
# File 'lib/logux/response.rb', line 5 def @meta end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/logux/response.rb', line 5 def status @status end |
Instance Method Details
#format ⇒ Object
14 15 16 |
# File 'lib/logux/response.rb', line 14 def format [status, custom_data || .id] end |