Class: Dickburt::Response
- Inherits:
-
Object
- Object
- Dickburt::Response
- Defined in:
- lib/dickburt/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#message_type ⇒ Object
Returns the value of attribute message_type.
Instance Method Summary collapse
-
#initialize(body, message_type) ⇒ Response
constructor
A new instance of Response.
- #to_campfire_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(body, message_type) ⇒ Response
Returns a new instance of Response.
5 6 7 8 |
# File 'lib/dickburt/response.rb', line 5 def initialize(body, ) @message_type = @body = body end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/dickburt/response.rb', line 3 def body @body end |
#message_type ⇒ Object
Returns the value of attribute message_type.
2 3 4 |
# File 'lib/dickburt/response.rb', line 2 def @message_type end |
Instance Method Details
#to_campfire_hash ⇒ Object
10 11 12 |
# File 'lib/dickburt/response.rb', line 10 def to_campfire_hash {:message => {:body => @body, :type => @message_type + "Message"}} end |
#to_json ⇒ Object
14 15 16 |
# File 'lib/dickburt/response.rb', line 14 def to_json self.to_campfire_hash.to_json end |