Class: Sinatra::Hat::Action

Inherits:
Object show all
Defined in:
lib/sinatras-hat/action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(maker, name, handler) ⇒ Action

Returns a new instance of Action.



6
7
8
# File 'lib/sinatras-hat/action.rb', line 6

def initialize(maker, name, handler)
  @maker, @handler = maker, handler
end

Instance Attribute Details

#handlerObject (readonly)

Returns the value of attribute handler.



4
5
6
# File 'lib/sinatras-hat/action.rb', line 4

def handler
  @handler
end

#makerObject (readonly)

Returns the value of attribute maker.



4
5
6
# File 'lib/sinatras-hat/action.rb', line 4

def maker
  @maker
end

Instance Method Details

#handle(event) ⇒ Object



10
11
12
# File 'lib/sinatras-hat/action.rb', line 10

def handle(event)
  handler[event.params]
end