Class: BrDanfe::Mdfe

Inherits:
Object
  • Object
show all
Defined in:
lib/br_danfe/mdfe.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ Mdfe

Returns a new instance of Mdfe.



9
10
11
12
13
# File 'lib/br_danfe/mdfe.rb', line 9

def initialize(xml)
  @xml = BrDanfe::XML.new(xml)
  @pdf = MdfeLib::Document.new
  @logo_options = BrDanfe::Logo::Config.new
end

Instance Attribute Details

#logo_optionsObject (readonly)

Returns the value of attribute logo_options.



7
8
9
# File 'lib/br_danfe/mdfe.rb', line 7

def logo_options
  @logo_options
end

Instance Method Details

#render_pdfObject



20
21
22
23
# File 'lib/br_danfe/mdfe.rb', line 20

def render_pdf
  generate
  @pdf.render
end

#save_pdf(filename) ⇒ Object



15
16
17
18
# File 'lib/br_danfe/mdfe.rb', line 15

def save_pdf(filename)
  generate
  @pdf.render_file(filename)
end