module Sanford::ServiceHandler::InstanceMethods

Public Class Methods

new(runner) click to toggle source
# File lib/sanford/service_handler.rb, line 15
def initialize(runner)
  @sanford_runner = runner
end

Public Instance Methods

==(other_handler) click to toggle source
# File lib/sanford/service_handler.rb, line 49
def ==(other_handler)
  self.class == other_handler.class
end
init!() click to toggle source
# File lib/sanford/service_handler.rb, line 25
def init!
end
inspect() click to toggle source
# File lib/sanford/service_handler.rb, line 44
def inspect
  reference = '0x0%x' % (self.object_id << 1)
  "#<#{self.class}:#{reference} @request=#{request.inspect}>"
end
run!() click to toggle source
# File lib/sanford/service_handler.rb, line 35
def run!
end
sanford_init() click to toggle source
# File lib/sanford/service_handler.rb, line 19
def sanford_init
  self.sanford_run_callback 'before_init'
  self.init!
  self.sanford_run_callback 'after_init'
end
sanford_run() click to toggle source
# File lib/sanford/service_handler.rb, line 28
def sanford_run
  self.sanford_run_callback 'before_run'
  data = self.run!
  self.sanford_run_callback 'after_run'
  [200, data]
end
sanford_run_callback(callback) click to toggle source
# File lib/sanford/service_handler.rb, line 38
def sanford_run_callback(callback)
  (self.class.send("#{callback}_callbacks") || []).each do |callback|
    self.instance_eval(&callback)
  end
end

Private Instance Methods

data(*args) click to toggle source
# File lib/sanford/service_handler.rb, line 66
def data(*args);    @sanford_runner.data(*args);    end
halt(*args) click to toggle source
# File lib/sanford/service_handler.rb, line 67
def halt(*args);    @sanford_runner.halt(*args);    end
logger() click to toggle source

utils

# File lib/sanford/service_handler.rb, line 58
def logger; @sanford_runner.logger; end
params() click to toggle source
# File lib/sanford/service_handler.rb, line 62
def params;  @sanford_runner.params;  end
partial(*args) click to toggle source
# File lib/sanford/service_handler.rb, line 69
def partial(*args); @sanford_runner.partial(*args); end
render(*args) click to toggle source
# File lib/sanford/service_handler.rb, line 68
def render(*args);  @sanford_runner.render(*args);  end
request() click to toggle source

request

# File lib/sanford/service_handler.rb, line 61
def request; @sanford_runner.request; end
status(*args) click to toggle source

response

# File lib/sanford/service_handler.rb, line 65
def status(*args);  @sanford_runner.status(*args);  end