Class: Coolline::Handler
- Inherits:
-
Struct
- Object
- Struct
- Coolline::Handler
- Defined in:
- lib/coolline/handler.rb
Overview
A handler is a simple object used to match keys.
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#char ⇒ Object
Returns the value of attribute char.
Instance Method Summary collapse
- #===(other_char) ⇒ Object
- #call(cool) ⇒ Object
-
#initialize(char, &block) ⇒ Handler
constructor
A new instance of Handler.
- #old_initialize ⇒ Object
Constructor Details
#initialize(char, &block) ⇒ Handler
Returns a new instance of Handler.
5 6 7 |
# File 'lib/coolline/handler.rb', line 5 def initialize(char, &block) old_initialize(char, block) end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
3 4 5 |
# File 'lib/coolline/handler.rb', line 3 def block @block end |
#char ⇒ Object
Returns the value of attribute char
3 4 5 |
# File 'lib/coolline/handler.rb', line 3 def char @char end |
Instance Method Details
#===(other_char) ⇒ Object
9 10 11 |
# File 'lib/coolline/handler.rb', line 9 def ===(other_char) char === other_char end |
#call(cool) ⇒ Object
13 14 15 |
# File 'lib/coolline/handler.rb', line 13 def call(cool) block.call(cool) end |
#old_initialize ⇒ Object
4 |
# File 'lib/coolline/handler.rb', line 4 alias old_initialize initialize |