Class: Line::Bot::Message::Image
- Defined in:
- lib/line/bot/message/image.rb
Instance Attribute Summary collapse
-
#image_url ⇒ Object
readonly
Returns the value of attribute image_url.
-
#preview_url ⇒ Object
readonly
Returns the value of attribute preview_url.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Line::Bot::Message::Base
Instance Attribute Details
#image_url ⇒ Object (readonly)
Returns the value of attribute image_url.
5 6 7 |
# File 'lib/line/bot/message/image.rb', line 5 def image_url @image_url end |
#preview_url ⇒ Object (readonly)
Returns the value of attribute preview_url.
5 6 7 |
# File 'lib/line/bot/message/image.rb', line 5 def preview_url @preview_url end |
Instance Method Details
#content ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/line/bot/message/image.rb', line 7 def content { contentType: ContentType::IMAGE, toType: recipient_type, originalContentUrl: self[:image_url], previewImageUrl: self[:preview_url] } end |
#valid? ⇒ Boolean
16 17 18 |
# File 'lib/line/bot/message/image.rb', line 16 def valid? !self[:image_url].nil? && ![:preview_url].nil? end |