Class: Line::Bot::Message::Text

Inherits:
Base
  • Object
show all
Defined in:
lib/line/bot/message/text.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
# File 'lib/line/bot/message/text.rb', line 8

def content
  {
    contentType: ContentType::TEXT,
    toType: 1,
    text: attrs[:text]
  }
end

#valid?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/line/bot/message/text.rb', line 16

def valid?
  !attrs[:text].nil?
end