Class: Moon::Response::JSON::Message
- Inherits:
-
Moon::Response::JSON
- Object
- Base
- Moon::Response::JSON
- Moon::Response::JSON::Message
- Defined in:
- lib/moon/response/json/message.rb
Overview
Moon::Response::JSON::Message provides a simple response with one message
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#message ⇒ Object
Returns the value of attribute message.
Attributes inherited from Moon::Response::JSON
Instance Method Summary collapse
- #hash ⇒ Object
-
#initialize(status, message, id = nil) ⇒ Message
constructor
A new instance of Message.
Methods inherited from Moon::Response::JSON
Methods inherited from Base
Constructor Details
#initialize(status, message, id = nil) ⇒ Message
Returns a new instance of Message.
8 9 10 11 |
# File 'lib/moon/response/json/message.rb', line 8 def initialize(status, , id = nil) @message, @id = , id super status end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/moon/response/json/message.rb', line 6 def id @id end |
#message ⇒ Object
Returns the value of attribute message.
5 6 7 |
# File 'lib/moon/response/json/message.rb', line 5 def @message end |
Instance Method Details
#hash ⇒ Object
13 14 15 16 |
# File 'lib/moon/response/json/message.rb', line 13 def hash id = self.id { :message => }.merge(id ? { :id => id } : { }) end |