Class: BrDanfe::DanfeLib::NfceLib::Key

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

Instance Method Summary collapse

Constructor Details

#initialize(pdf, xml) ⇒ Key

Returns a new instance of Key.



5
6
7
8
# File 'lib/br_danfe/danfe_lib/nfce_lib/key.rb', line 5

def initialize(pdf, xml)
  @pdf = pdf
  @xml = xml
end

Instance Method Details

#renderObject



10
11
12
13
14
15
16
# File 'lib/br_danfe/danfe_lib/nfce_lib/key.rb', line 10

def render
  @pdf.render_blank_line

  @pdf.text 'Consulte pela Chave de Acesso em', size: 9, align: :center, style: :bold
  @pdf.text @xml['urlChave'], size: 9, align: :center
  @pdf.text @xml['chNFe'].gsub(/(\d)(?=(\d\d\d\d)+(?!\d))/, '\\1 '), size: 8, align: :center
end