Class: Abacos::Response

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/abacos/response.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


18
19
20
# File 'lib/abacos/response.rb', line 18

def success?
  (doc.has_key?(:tipo) ? doc : doc[:resultado_operacao])[:tipo] == "tdreSucesso"
end