Sha256: 5e4b8a02308f606357f9d4d051b007055ed58d0823299e624f8ae11fb143d23a
Contents?: true
Size: 1.2 KB
Versions: 2
Compression:
Stored size: 1.2 KB
Contents
class Cieloz::RequisicaoTransacao class DadosAvs CONFERE = 'C' NAO_CONFERE = 'N' INDISPONIVEL = 'I' TEMPORARIAMENTE_INDISPONIVEL = 'T' NAO_SUPORTADO = 'X' include Cieloz::Helpers attr_accessor :cep, :endereco, :complemento, :numero, :bairro validates :cep, presence: true, format: { with: /\A(\d{5}-\d{3})\z/ } def self.map(source, opts={}) cep, endereco, complemento, numero, bairro = attrs_from source, opts, :cep, :endereco, :complemento, :numero, :bairro new source: source, opts: opts, cep: cep, endereco: endereco, complemento: complemento, numero: numero, bairro: bairro end def attributes { endereco: @endereco, complemento: @complemento, numero: @numero, bairro: @bairro, cep: @cep } end def build_xml builder builder.tag! 'avs' do builder.cdata! attr_to_xml end end private def attr_to_xml x = Builder::XmlMarkup.new @xml = x.tag! 'dados-avs' do attributes.each do |attr, value| next if value.nil? x.tag! dasherize_attr(attr), value end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
cieloz-0.0.21 | lib/cieloz/requisicao_transacao/dados_avs.rb |
cieloz-0.0.20 | lib/cieloz/requisicao_transacao/dados_avs.rb |