Class: Resat::Handler

Inherits:
Object
  • Object
show all
Includes:
Kwalify::Util::HashLike
Defined in:
lib/handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#failuresObject

Returns the value of attribute failures.



15
16
17
# File 'lib/handler.rb', line 15

def failures
  @failures
end

Instance Method Details

#prepareObject



17
18
19
20
# File 'lib/handler.rb', line 17

def prepare
  @failures = []
  Log.info("Running handler '#{@name}'")      
end

#run(request) ⇒ Object



22
23
24
25
26
27
# File 'lib/handler.rb', line 22

def run(request)
  klass = module_class(@module)
  h = klass.new
  h.process(request.request, request.response)
  @failures += h.failures.values.to_a if h.failures
end