Class: Retl::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/retl/handlers/handler.rb

Direct Known Subclasses

ForkHandler, PathHandler, StepHandler

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHandler

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

#descriptionObject

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

Raises:

  • (NotImplementedError)


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

#outputObject



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