class BrDanfe::DanfeLib::NfceLib::Key

Public Class Methods

new(pdf, xml) click to toggle source
# File lib/br_danfe/danfe_lib/nfce_lib/key.rb, line 5
def initialize(pdf, xml)
  @pdf = pdf
  @xml = xml
end

Public Instance Methods

render() click to toggle source
# 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