Class: Sinatra::Hat::Action
Instance Attribute Summary collapse
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
-
#maker ⇒ Object
readonly
Returns the value of attribute maker.
Instance Method Summary collapse
- #handle(event) ⇒ Object
-
#initialize(maker, name, handler) ⇒ Action
constructor
A new instance of Action.
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
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
4 5 6 |
# File 'lib/sinatras-hat/action.rb', line 4 def handler @handler end |
#maker ⇒ Object (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 |