Class: AndSon::Client
- Inherits:
-
Object
- Object
- AndSon::Client
- Includes:
- CallRunnerMethods
- Defined in:
- lib/and-son/client.rb
Constant Summary collapse
- DEFAULT_TIMEOUT =
seconds
60
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#responses ⇒ Object
readonly
Returns the value of attribute responses.
Instance Method Summary collapse
-
#call(*args, &block) ⇒ Object
proxy the call method to the call runner.
- #call_runner ⇒ Object
-
#initialize(host, port) ⇒ Client
constructor
A new instance of Client.
Methods included from CallRunnerMethods
Constructor Details
#initialize(host, port) ⇒ Client
Returns a new instance of Client.
48 49 50 51 |
# File 'lib/and-son/client.rb', line 48 def initialize(host, port) @host, @port = host, port @responses = AndSon::StoredResponses.new end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
46 47 48 |
# File 'lib/and-son/client.rb', line 46 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
46 47 48 |
# File 'lib/and-son/client.rb', line 46 def port @port end |
#responses ⇒ Object (readonly)
Returns the value of attribute responses.
46 47 48 |
# File 'lib/and-son/client.rb', line 46 def responses @responses end |
Instance Method Details
#call(*args, &block) ⇒ Object
proxy the call method to the call runner
54 |
# File 'lib/and-son/client.rb', line 54 def call(*args, &block); self.call_runner.call(*args, &block); end |
#call_runner ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/and-son/client.rb', line 56 def call_runner # always start with this default CallRunner CallRunner.new({ :host => host, :port => port, :timeout_value => (ENV['ANDSON_TIMEOUT'] || DEFAULT_TIMEOUT).to_f, :params_value => {}, :logger_value => NullLogger.new, :responses => @responses, }) end |