Class: Otaku::Handler
- Inherits:
-
Object
- Object
- Otaku::Handler
- Defined in:
- lib/otaku/handler.rb
Instance Method Summary collapse
-
#initialize(handler) ⇒ Handler
constructor
A new instance of Handler.
- #marshal_dump ⇒ Object
- #marshal_load(data) ⇒ Object
- #process(data) ⇒ Object
- #root ⇒ Object
Constructor Details
#initialize(handler) ⇒ Handler
Returns a new instance of Handler.
4 5 6 |
# File 'lib/otaku/handler.rb', line 4 def initialize(handler) @proc = SerializableProc.new(&handler) end |
Instance Method Details
#marshal_dump ⇒ Object
16 17 18 |
# File 'lib/otaku/handler.rb', line 16 def marshal_dump @proc end |
#marshal_load(data) ⇒ Object
20 21 22 |
# File 'lib/otaku/handler.rb', line 20 def marshal_load(data) @proc = data end |
#process(data) ⇒ Object
8 9 10 |
# File 'lib/otaku/handler.rb', line 8 def process(data) @proc.call(data) end |
#root ⇒ Object
12 13 14 |
# File 'lib/otaku/handler.rb', line 12 def root @proc.file end |