lib/cieloz/requisicao_tid.rb in cieloz-0.0.13 vs lib/cieloz/requisicao_tid.rb in cieloz-0.0.14
- old
+ new
@@ -1,14 +1,36 @@
module Cieloz
class RequisicaoTid < Requisicao
+ module ClassMethods
+ def map source, opts={}
+ tid = attrs_from source, opts, :tid
+ new source: source, opts: opts, tid: tid
+ end
+ end
+
+ def self.inherited(target)
+ target.extend ClassMethods
+ end
+
attr_accessor :tid
def attributes
{ tid: @tid, dados_ec: @dados_ec }
end
end
class RequisicaoTidValor < RequisicaoTid
+ module ClassMethods
+ def map source, opts={}
+ tid, valor = attrs_from source, opts, :tid, :valor
+ new source: source, opts: opts, tid: tid, valor: valor
+ end
+ end
+
+ def self.inherited(target)
+ target.extend ClassMethods
+ end
+
attr_accessor :valor
def attributes
{ tid: @tid, dados_ec: @dados_ec, valor: @valor }
end