Class: Retl::Handler
- Inherits:
-
Object
show all
- Defined in:
- lib/retl/handlers/handler.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of Handler.
5
6
7
8
|
# File 'lib/retl/handlers/handler.rb', line 5
def initialize
@output = []
@description = "unknown"
end
|
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
3
4
5
|
# File 'lib/retl/handlers/handler.rb', line 3
def description
@description
end
|
Instance Method Details
#call(data, context) ⇒ Object
18
19
20
|
# File 'lib/retl/handlers/handler.rb', line 18
def call(data, context)
raise NotImplementedError, "Handlers much implement the #push_in(data, context) method"
end
|
#output ⇒ Object
10
11
12
|
# File 'lib/retl/handlers/handler.rb', line 10
def output
@output.slice!(0, @output.count)
end
|
#push_in(data, context) ⇒ Object
14
15
16
|
# File 'lib/retl/handlers/handler.rb', line 14
def push_in(data, context)
call(data, context)
end
|