Sha256: 9b9e0573a7179d89f676f8b50b5ddabc4275649af643772ea68f332679777e55

Contents?: true

Size: 536 Bytes

Versions: 2

Compression:

Stored size: 536 Bytes

Contents

require 'sanford/runner'

module Sanford

  class SanfordRunner
    include Sanford::Runner

    # call the handler init and the handler run - if the init halts, run won't
    # be called.

    def run!
      run_callbacks self.handler_class.before_callbacks
      self.handler.init
      response_args = self.handler.run
      run_callbacks self.handler_class.after_callbacks
      response_args
    end

    private

    def run_callbacks(callbacks)
      callbacks.each{|proc| self.handler.instance_eval(&proc) }
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sanford-0.10.1 lib/sanford/sanford_runner.rb
sanford-0.10.0 lib/sanford/sanford_runner.rb