Module: LCBO::CrawlKit::Eventable::ClassMethods

Defined in:
lib/lcbo/crawlkit/eventable.rb

Instance Method Summary collapse

Instance Method Details

#callbacksObject



29
30
31
# File 'lib/lcbo/crawlkit/eventable.rb', line 29

def callbacks
  @callbacks || []
end

#on(event_type, *method_names) ⇒ Object



22
23
24
25
26
27
# File 'lib/lcbo/crawlkit/eventable.rb', line 22

def on(event_type, *method_names)
  @callbacks ||= []
  method_names.each do |method_name|
    @callbacks << Callback.new(event_type, method_name)
  end
end