Module: AndSon::CallRunner::InstanceMethods

Included in:
AndSon::CallRunner
Defined in:
lib/and-son/call_runner.rb

Instance Method Summary collapse

Instance Method Details

#logger(passed_logger) ⇒ Object



98
99
100
# File 'lib/and-son/call_runner.rb', line 98

def logger(passed_logger)
  self.call_runner.tap{ |r| r.logger_value = passed_logger }
end

#params(hash = nil) ⇒ Object



91
92
93
94
95
96
# File 'lib/and-son/call_runner.rb', line 91

def params(hash = nil)
  if !hash.kind_of?(Hash)
    raise ArgumentError, "expected params to be a Hash instead of a #{hash.class}"
  end
  self.call_runner.tap{ |r| r.params_value.merge!(stringify_keys(hash)) }
end

#timeout(seconds) ⇒ Object

define methods here to allow configuring call runner params. be sure to use ‘tap` to return whatever instance `self.call_runner` returns so you can method-chain. `self.call_runner` returns a new runner instance if called on a client, but returns the chained instance if called on a runner



87
88
89
# File 'lib/and-son/call_runner.rb', line 87

def timeout(seconds)
  self.call_runner.tap{ |r| r.timeout_value = seconds.to_f }
end