Class: Cieloz::Requisicao::Resposta

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Serializers::Xml, Helpers
Defined in:
lib/cieloz/requisicao/resposta.rb

Direct Known Subclasses

Erro, Transacao

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from Helpers

#attributes=, included, #initialize

Instance Attribute Details

#xmlObject (readonly)

Returns the value of attribute xml.



7
8
9
# File 'lib/cieloz/requisicao/resposta.rb', line 7

def xml
  @xml
end

Class Method Details

.from(xml) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/cieloz/requisicao/resposta.rb', line 9

def self.from xml
  obj = new
  begin
    obj = obj.from_xml xml
  rescue
    # makes it resilient to bad responses,
    # allowing them to be logged
  end
  obj.instance_variable_set :@xml, xml
  obj
end