Class: Snoopy::Client
- Inherits:
-
Object
- Object
- Snoopy::Client
- Defined in:
- lib/snoopy_afip/client.rb
Instance Attribute Summary collapse
-
#savon ⇒ Object
Returns the value of attribute savon.
Instance Method Summary collapse
- #call(service, args = {}) ⇒ Object
-
#initialize(attrs) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(attrs) ⇒ Client
5 6 7 |
# File 'lib/snoopy_afip/client.rb', line 5 def initialize(attrs) @savon = Savon.client(attrs) end |
Instance Attribute Details
#savon ⇒ Object
Returns the value of attribute savon.
3 4 5 |
# File 'lib/snoopy_afip/client.rb', line 3 def savon @savon end |
Instance Method Details
#call(service, args = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/snoopy_afip/client.rb', line 9 def call service, args={} Timeout::timeout(Snoopy.open_timeout) do savon.call(service, args).body end rescue Timeout::Error raise Snoopy::Exception::ServerTimeout.new rescue => e raise Snoopy::Exception::ClientError.new(e.) end |