Class: MessageQuickly::Messaging::MessageEvent
- Defined in:
- lib/message_quickly/messaging/message_event.rb
Instance Attribute Summary collapse
-
#attachments ⇒ Object
readonly
Returns the value of attribute attachments.
-
#mid ⇒ Object
readonly
Returns the value of attribute mid.
-
#quick_reply ⇒ Object
readonly
Returns the value of attribute quick_reply.
-
#seq ⇒ Object
readonly
Returns the value of attribute seq.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from Event
#entry, #recipient, #sender, #timestamp
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ MessageEvent
constructor
A new instance of MessageEvent.
- #is_echo? ⇒ Boolean
- #webhook_name ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ MessageEvent
Returns a new instance of MessageEvent.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/message_quickly/messaging/message_event.rb', line 9 def initialize(params = {}) @attachments = params[:message].delete(:attachments).collect { || Attachment.new() } if params.dig(:message, :attachments) @attachments ||= [] @quick_reply = QuickReply.new(params[:message][:quick_reply]) if params.dig(:message, :quick_reply) if params.include? :message @mid = params[:message][:mid] @seq = params[:message][:seq] @is_echo = params[:message][:is_echo] @text = params[:message][:text] params.delete(:message) end super(params) end |
Instance Attribute Details
#attachments ⇒ Object (readonly)
Returns the value of attribute attachments.
7 8 9 |
# File 'lib/message_quickly/messaging/message_event.rb', line 7 def @attachments end |
#mid ⇒ Object (readonly)
Returns the value of attribute mid.
7 8 9 |
# File 'lib/message_quickly/messaging/message_event.rb', line 7 def mid @mid end |
#quick_reply ⇒ Object (readonly)
Returns the value of attribute quick_reply.
7 8 9 |
# File 'lib/message_quickly/messaging/message_event.rb', line 7 def quick_reply @quick_reply end |
#seq ⇒ Object (readonly)
Returns the value of attribute seq.
7 8 9 |
# File 'lib/message_quickly/messaging/message_event.rb', line 7 def seq @seq end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
7 8 9 |
# File 'lib/message_quickly/messaging/message_event.rb', line 7 def text @text end |
Instance Method Details
#is_echo? ⇒ Boolean
32 33 34 |
# File 'lib/message_quickly/messaging/message_event.rb', line 32 def is_echo? @is_echo end |
#webhook_name ⇒ Object
28 29 30 |
# File 'lib/message_quickly/messaging/message_event.rb', line 28 def webhook_name :messages end |