Class: Messenger::Parameters::Message
- Inherits:
-
Object
- Object
- Messenger::Parameters::Message
- Includes:
- Callback
- Defined in:
- lib/messenger/parameters/message.rb
Instance Attribute Summary collapse
-
#attachments ⇒ Object
Returns the value of attribute attachments.
-
#mid ⇒ Object
Returns the value of attribute mid.
-
#seq ⇒ Object
Returns the value of attribute seq.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #build_attachments(attachments) ⇒ Object
-
#initialize(mid:, seq:, text: nil, attachments: nil) ⇒ Message
constructor
A new instance of Message.
Methods included from Callback
Constructor Details
#initialize(mid:, seq:, text: nil, attachments: nil) ⇒ Message
Returns a new instance of Message.
8 9 10 11 12 13 |
# File 'lib/messenger/parameters/message.rb', line 8 def initialize(mid:, seq:, text: nil, attachments: nil) @mid = mid @seq = seq @text = text if text.present? @attachments = () if .present? end |
Instance Attribute Details
#attachments ⇒ Object
Returns the value of attribute attachments.
6 7 8 |
# File 'lib/messenger/parameters/message.rb', line 6 def @attachments end |
#mid ⇒ Object
Returns the value of attribute mid.
6 7 8 |
# File 'lib/messenger/parameters/message.rb', line 6 def mid @mid end |
#seq ⇒ Object
Returns the value of attribute seq.
6 7 8 |
# File 'lib/messenger/parameters/message.rb', line 6 def seq @seq end |
#text ⇒ Object
Returns the value of attribute text.
6 7 8 |
# File 'lib/messenger/parameters/message.rb', line 6 def text @text end |
Instance Method Details
#build_attachments(attachments) ⇒ Object
15 16 17 |
# File 'lib/messenger/parameters/message.rb', line 15 def () .map { || Attachment.new(.symbolize_keys) } end |