Module: SardonyxRing::DSL::ClassMethods

Defined in:
lib/sardonyx_ring/dsl.rb

Instance Method Summary collapse

Instance Method Details

#action(event_name, &block) ⇒ Object



59
60
61
62
63
64
# File 'lib/sardonyx_ring/dsl.rb', line 59

def action(event_name, &block)
  action_handlers.push Handlers::ActionHandler.new(
    event_name,
    create_handler_method(&block)
  )
end

#action_handlersObject



30
31
32
# File 'lib/sardonyx_ring/dsl.rb', line 30

def action_handlers
  @action_handlers ||= []
end

#cron_handlersObject



46
47
48
# File 'lib/sardonyx_ring/dsl.rb', line 46

def cron_handlers
  @cron_handlers ||= []
end

#event(event_name, &block) ⇒ Object



73
74
75
76
77
78
# File 'lib/sardonyx_ring/dsl.rb', line 73

def event(event_name, &block)
  event_handlers.push Handlers::EventHandler.new(
    event_name,
    create_handler_method(&block)
  )
end

#event_handlersObject



38
39
40
# File 'lib/sardonyx_ring/dsl.rb', line 38

def event_handlers
  @event_handlers ||= []
end

#every(cron_format, &block) ⇒ Object



80
81
82
83
84
85
# File 'lib/sardonyx_ring/dsl.rb', line 80

def every(cron_format, &block)
  cron_handlers.push Handlers::CronHandler.new(
    cron_format,
    create_handler_method(&block)
  )
end

#message(pattern, &block) ⇒ Object Also known as: on



50
51
52
53
54
55
# File 'lib/sardonyx_ring/dsl.rb', line 50

def message(pattern, &block)
  message_handlers.push Handlers::MessageHandler.new(
    pattern,
    create_handler_method(&block)
  )
end

#message_handlersObject



34
35
36
# File 'lib/sardonyx_ring/dsl.rb', line 34

def message_handlers
  @message_handlers ||= []
end

#view(callback_id, &block) ⇒ Object



66
67
68
69
70
71
# File 'lib/sardonyx_ring/dsl.rb', line 66

def view(callback_id, &block)
  view_handlers.push Handlers::ViewHandler.new(
    callback_id,
    create_handler_method(&block)
  )
end

#view_handlersObject



42
43
44
# File 'lib/sardonyx_ring/dsl.rb', line 42

def view_handlers
  @view_handlers ||= []
end