Class: Line::Bot::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/line/bot/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Event

Returns a new instance of Event.



7
8
9
10
11
12
13
# File 'lib/line/bot/event.rb', line 7

def initialize(options = {})
  options.each do |key, value|
    instance_variable_set("@#{key}", value)
  end

  @content = parse_content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



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

def content
  @content
end

#event_typeObject (readonly)

Returns the value of attribute event_type.



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

def event_type
  @event_type
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


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

def valid?
  !@event_type.nil? && !@content.nil?
end