class Tradesman::Template

Public Instance Methods

call(params) click to toggle source
# File lib/tradesman/template.rb, line 8
def call(params)
  params = query_for_ids(params) if (params.is_a?(Hash) && params[:id] && params[:id].is_a?(Hash))
  return execute_single(params) unless (params.is_a?(Array) || params[:id].is_a?(Array) || params[:params].is_a?(Array))
  execute_multiple(params)
rescue *self.class.expected_horza_errors_map.keys => e
  invalid! e
end

Private Instance Methods

execute_multiple(params_hash) click to toggle source
# File lib/tradesman/template.rb, line 26
def execute_multiple(params_hash)
  raise Tradesman::MethodNotImplemented.new('You must implement execute_multiple in a child class')
end
execute_single(params) click to toggle source
# File lib/tradesman/template.rb, line 22
def execute_single(params)
  raise Tradesman::MethodNotImplemented.new('You must implement execute_single in a child class')
end
query_for_ids(params) click to toggle source
# File lib/tradesman/template.rb, line 18
def query_for_ids(params)
  raise Tradesman::MethodNotImplemented.new('You must implement query_for_ids in a child class')
end