Class: BrDanfe::DanfeLib::Base

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

Direct Known Subclasses

Nfce, Nfe

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xmls) ⇒ Base

Returns a new instance of Base.



6
7
8
9
10
11
12
# File 'lib/br_danfe/danfe_lib/base.rb', line 6

def initialize(xmls)
  @xmls = xmls
  @document = document
  @options = BrDanfe::Logo::Config.new

  create_watermark
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/br_danfe/danfe_lib/base.rb', line 4

def options
  @options
end

Instance Method Details

#render_pdf(footer_info = '') ⇒ Object



19
20
21
22
# File 'lib/br_danfe/danfe_lib/base.rb', line 19

def render_pdf(footer_info = '')
  generate footer_info
  @document.render
end

#save_pdf(filename, footer_info = '') ⇒ Object



14
15
16
17
# File 'lib/br_danfe/danfe_lib/base.rb', line 14

def save_pdf(filename, footer_info = '')
  generate footer_info
  @document.render_file filename
end