Module: AndSon::CallRunnerMethods
- Included in:
- CallRunner, Client
- Defined in:
- lib/and-son/client.rb
Instance Method Summary collapse
- #logger(passed_logger) ⇒ Object
- #params(hash = nil) ⇒ Object
-
#timeout(seconds) ⇒ Object
define methods here to allow configuring call runner params.
Instance Method Details
#logger(passed_logger) ⇒ Object
29 30 31 |
# File 'lib/and-son/client.rb', line 29 def logger(passed_logger) self.call_runner.tap{|r| r.logger_value = passed_logger } end |
#params(hash = nil) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/and-son/client.rb', line 22 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!(self.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
18 19 20 |
# File 'lib/and-son/client.rb', line 18 def timeout(seconds) self.call_runner.tap{|r| r.timeout_value = seconds.to_f } end |