Class: Facebook::Messenger::Incoming::Postback
- Inherits:
-
Object
- Object
- Facebook::Messenger::Incoming::Postback
- Defined in:
- lib/facebook/messenger/incoming/postback.rb
Overview
The Postback class represents an incoming Facebook Messenger postback.
Instance Method Summary collapse
-
#initialize(payload) ⇒ Postback
constructor
A new instance of Postback.
- #payload ⇒ Object
- #recipient ⇒ Object
- #sender ⇒ Object
- #sent_at ⇒ Object
Constructor Details
#initialize(payload) ⇒ Postback
Returns a new instance of Postback.
6 7 8 |
# File 'lib/facebook/messenger/incoming/postback.rb', line 6 def initialize(payload) @payload = payload end |
Instance Method Details
#payload ⇒ Object
22 23 24 |
# File 'lib/facebook/messenger/incoming/postback.rb', line 22 def payload @payload['postback']['payload'] end |
#recipient ⇒ Object
14 15 16 |
# File 'lib/facebook/messenger/incoming/postback.rb', line 14 def recipient @payload['recipient'] end |
#sender ⇒ Object
10 11 12 |
# File 'lib/facebook/messenger/incoming/postback.rb', line 10 def sender @payload['sender'] end |
#sent_at ⇒ Object
18 19 20 |
# File 'lib/facebook/messenger/incoming/postback.rb', line 18 def sent_at Time.at(@payload['timestamp'] / 1000) end |