Class: Line::Bot::Message::Base

Inherits:
Hash
  • Object
show all
Defined in:
lib/line/bot/message/base.rb

Direct Known Subclasses

Text

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Base

Returns a new instance of Base.



7
8
9
# File 'lib/line/bot/message/base.rb', line 7

def initialize(attrs = {})
  self.merge!(attrs)
end

Instance Attribute Details

#recipient_typeObject (readonly)

Returns the value of attribute recipient_type.



5
6
7
# File 'lib/line/bot/message/base.rb', line 5

def recipient_type
  @recipient_type
end

Instance Method Details

#contentObject

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/line/bot/message/base.rb', line 19

def content
  raise NotImplementedError, "Should implement this method in child class"
end

#event_typeObject



15
16
17
# File 'lib/line/bot/message/base.rb', line 15

def event_type
  Line::Bot::EventType::MESSAGE
end

#valid?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/line/bot/message/base.rb', line 23

def valid?
  raise NotImplementedError, "Should implement this method in child class"
end