Class: BoaVista::Client
- Inherits:
-
Object
- Object
- BoaVista::Client
- Defined in:
- lib/boa_vista/client.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(attributes, request = BoaVista::Request, response = BoaVista::Response) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(attributes, request = BoaVista::Request, response = BoaVista::Response) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 |
# File 'lib/boa_vista/client.rb', line 7 def initialize(attributes, request = BoaVista::Request, response = BoaVista::Response) @attributes = attributes @request = request @response = response end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/boa_vista/client.rb', line 13 def call begin response = nil execute_with_timeout do response = BoaVista::Http.new(uri(create_request)).call.body end @response.new(parsed_response(response)).read rescue Timeout::Error fail Errors::Timeout.new('timed out') end end |