Class: Cieloz::RequisicaoTransacao::DadosPedido
- Inherits:
-
Object
- Object
- Cieloz::RequisicaoTransacao::DadosPedido
- Includes:
- Helpers
- Defined in:
- lib/cieloz/requisicao_transacao/dados_pedido.rb
Constant Summary collapse
- IDIOMAS =
portugues, ingles, espanhol
[ "PT", "EN", "ES" ]
Instance Attribute Summary collapse
-
#data_hora ⇒ Object
Returns the value of attribute data_hora.
-
#descricao ⇒ Object
Returns the value of attribute descricao.
-
#idioma ⇒ Object
Returns the value of attribute idioma.
-
#moeda ⇒ Object
Returns the value of attribute moeda.
-
#numero ⇒ Object
Returns the value of attribute numero.
-
#soft_descriptor ⇒ Object
Returns the value of attribute soft_descriptor.
-
#valor ⇒ Object
Returns the value of attribute valor.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Helpers
#attributes=, included, #initialize
Instance Attribute Details
#data_hora ⇒ Object
Returns the value of attribute data_hora.
7 8 9 |
# File 'lib/cieloz/requisicao_transacao/dados_pedido.rb', line 7 def data_hora @data_hora end |
#descricao ⇒ Object
Returns the value of attribute descricao.
7 8 9 |
# File 'lib/cieloz/requisicao_transacao/dados_pedido.rb', line 7 def descricao @descricao end |
#idioma ⇒ Object
Returns the value of attribute idioma.
7 8 9 |
# File 'lib/cieloz/requisicao_transacao/dados_pedido.rb', line 7 def idioma @idioma end |
#moeda ⇒ Object
Returns the value of attribute moeda.
7 8 9 |
# File 'lib/cieloz/requisicao_transacao/dados_pedido.rb', line 7 def moeda @moeda end |
#numero ⇒ Object
Returns the value of attribute numero.
7 8 9 |
# File 'lib/cieloz/requisicao_transacao/dados_pedido.rb', line 7 def numero @numero end |
#soft_descriptor ⇒ Object
Returns the value of attribute soft_descriptor.
7 8 9 |
# File 'lib/cieloz/requisicao_transacao/dados_pedido.rb', line 7 def soft_descriptor @soft_descriptor end |
#valor ⇒ Object
Returns the value of attribute valor.
7 8 9 |
# File 'lib/cieloz/requisicao_transacao/dados_pedido.rb', line 7 def valor @valor end |
Class Method Details
.map(source, opts = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/cieloz/requisicao_transacao/dados_pedido.rb', line 20 def self.map(source, opts={}) mappings = attrs_from source, opts, :numero, :valor, :descricao, :data_hora, :moeda, :idioma, :soft_descriptor num, val, desc, time, cur, lang, soft = mappings val = (val * 100).round unless val.nil? or val.integer? time ||= Time.now cur ||= Cieloz::Configuracao.moeda lang ||= Cieloz::Configuracao.idioma soft ||= Cieloz::Configuracao.soft_descriptor new source: source, opts: opts, data_hora: time, numero: num, valor: val, moeda: cur, idioma: lang, descricao: desc, soft_descriptor: soft end |
Instance Method Details
#attributes ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/cieloz/requisicao_transacao/dados_pedido.rb', line 37 def attributes { numero: @numero, valor: @valor, moeda: @moeda, data_hora: @data_hora.strftime("%Y-%m-%dT%H:%M:%S"), descricao: @descricao, idioma: @idioma, soft_descriptor: @soft_descriptor } end |