Class: Dickburt::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/dickburt/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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)
  @message_type = message_type
  @body = body
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



3
4
5
# File 'lib/dickburt/response.rb', line 3

def body
  @body
end

#message_typeObject

Returns the value of attribute message_type.



2
3
4
# File 'lib/dickburt/response.rb', line 2

def message_type
  @message_type
end

Instance Method Details

#to_campfire_hashObject



10
11
12
# File 'lib/dickburt/response.rb', line 10

def to_campfire_hash
  {:message => {:body => @body, :type => @message_type + "Message"}}
end

#to_jsonObject



14
15
16
# File 'lib/dickburt/response.rb', line 14

def to_json
  self.to_campfire_hash.to_json
end