Class: Twterm::Event::AbstractEvent

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/twterm/event/abstract_event.rb

Instance Method Summary collapse

Methods included from Utils

check_type

Constructor Details

#initialize(*args) ⇒ AbstractEvent

Returns a new instance of AbstractEvent.



8
9
10
11
12
13
14
15
# File 'lib/twterm/event/abstract_event.rb', line 8

def initialize(*args)
  fields.zip(args).map(&:flatten).each do |name, type, value|
    check_type type, value

    instance_variable_set('@%s' % name, value)
    self.class.send(:attr_reader, name)
  end
end

Instance Method Details

#fieldsObject



17
18
19
# File 'lib/twterm/event/abstract_event.rb', line 17

def fields
  []
end