Class: Line::Bot::Message::Image

Inherits:
Base
  • Object
show all
Defined in:
lib/line/bot/message/image.rb

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#[], #event_type, #initialize

Constructor Details

This class inherits a constructor from Line::Bot::Message::Base

Instance Method Details

#contentObject



8
9
10
11
12
13
14
15
# File 'lib/line/bot/message/image.rb', line 8

def content
  {
    contentType: ContentType::IMAGE,
    toType: 1,
    originalContentUrl: attrs[:image_url],
    previewImageUrl: attrs[:preview_url],
  }
end

#valid?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/line/bot/message/image.rb', line 17

def valid?
  attrs[:image_url] && attrs[:preview_url]
end