Module: Brcobranca::Boleto::Template::Rghost
- Extended by:
- Rghost
- Includes:
- RGhost
- Included in:
- Rghost
- Defined in:
- lib/brcobranca/boleto/template/rghost.rb
Overview
Templates para usar com Rghost
Instance Method Summary collapse
-
#imprimir_lista(boletos, options = {}) ⇒ Stream
Gera o boleto em usando o formato desejado [:pdf, :jpg, :tif, :png, :ps, :laserjet, … etc].
-
#method_missing(m, *args) ⇒ Stream
Cria o métodos dinâmicos (to_pdf, to_gif e etc) com todos os fomátos válidos.
-
#to(formato = Brcobranca::Config::OPCOES[:tipo], options = {}) ⇒ Stream
Gera o boleto em usando o formato desejado [:pdf, :jpg, :tif, :png, :ps, :laserjet, … etc].
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Stream
Cria o métodos dinâmicos (to_pdf, to_gif e etc) com todos os fomátos válidos.
59 60 61 62 63 64 65 66 |
# File 'lib/brcobranca/boleto/template/rghost.rb', line 59 def method_missing(m, *args) method = m.to_s if method.start_with?("to_") modelo_generico(self, (args.first || {}).merge!({:formato => method[3..-1]})) else super end end |
Instance Method Details
#imprimir_lista(boletos, options = {}) ⇒ Stream
Gera o boleto em usando o formato desejado [:pdf, :jpg, :tif, :png, :ps, :laserjet, … etc]
43 44 45 46 47 48 49 50 51 |
# File 'lib/brcobranca/boleto/template/rghost.rb', line 43 def imprimir_lista(boletos, ={}) # Adicionando :formato apenas para garantir a compatibilidade com o codigo da versao 3 = Brcobranca::Config::OPCOES.merge({ :formato => Brcobranca::Config::OPCOES[:tipo] }).merge() modelo_generico_multipage(boletos, ) end |
#to(formato = Brcobranca::Config::OPCOES[:tipo], options = {}) ⇒ Stream
Gera o boleto em usando o formato desejado [:pdf, :jpg, :tif, :png, :ps, :laserjet, … etc]
30 31 32 33 34 35 36 |
# File 'lib/brcobranca/boleto/template/rghost.rb', line 30 def to(formato = Brcobranca::Config::OPCOES[:tipo], ={}) # Adicionando :formato apenas para garantir a compatibilidade com o codigo da versao 3 = Brcobranca::Config::OPCOES.merge() modelo_generico(self, .merge!({:formato => formato})) end |