Class: Sinbotra::Messenger::Message
- Inherits:
-
Object
- Object
- Sinbotra::Messenger::Message
- Defined in:
- lib/sinbotra/messenger/message.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#postback ⇒ Object
readonly
Returns the value of attribute postback.
-
#sender ⇒ Object
readonly
Returns the value of attribute sender.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(msg) ⇒ Message
constructor
A new instance of Message.
- #parse ⇒ Object
- #postback? ⇒ Boolean
Constructor Details
#initialize(msg) ⇒ Message
Returns a new instance of Message.
17 18 19 |
# File 'lib/sinbotra/messenger/message.rb', line 17 def initialize(msg) = msg end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/sinbotra/messenger/message.rb', line 10 def id @id end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
15 16 17 |
# File 'lib/sinbotra/messenger/message.rb', line 15 def location @location end |
#postback ⇒ Object (readonly)
Returns the value of attribute postback.
13 14 15 |
# File 'lib/sinbotra/messenger/message.rb', line 13 def postback @postback end |
#sender ⇒ Object (readonly)
Returns the value of attribute sender.
12 13 14 |
# File 'lib/sinbotra/messenger/message.rb', line 12 def sender @sender end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
14 15 16 |
# File 'lib/sinbotra/messenger/message.rb', line 14 def text @text end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
11 12 13 |
# File 'lib/sinbotra/messenger/message.rb', line 11 def end |
Class Method Details
.load(msg) ⇒ Object
6 7 8 |
# File 'lib/sinbotra/messenger/message.rb', line 6 def self.load(msg) new(msg).parse end |
Instance Method Details
#parse ⇒ Object
21 22 23 24 |
# File 'lib/sinbotra/messenger/message.rb', line 21 def parse self end |
#postback? ⇒ Boolean
26 27 28 |
# File 'lib/sinbotra/messenger/message.rb', line 26 def postback? !!postback end |