Class: Abacos::Response
- Inherits:
-
Object
- Object
- Abacos::Response
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/abacos/response.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(method, savon) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(method, savon) ⇒ Response
Returns a new instance of Response.
9 10 11 12 |
# File 'lib/abacos/response.rb', line 9 def initialize(method, savon) @method = method @savon = savon end |
Instance Method Details
#each(&block) ⇒ Object
14 15 16 |
# File 'lib/abacos/response.rb', line 14 def each(&block) (doc.has_key?(:rows) ? extract_values(doc[:rows]) : []).each &block end |
#success? ⇒ Boolean
18 19 20 |
# File 'lib/abacos/response.rb', line 18 def success? (doc.has_key?(:tipo) ? doc : doc[:resultado_operacao])[:tipo] == "tdreSucesso" end |