Class: BrDanfe::DanfeLib::NfceLib::Recipient

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

Instance Method Summary collapse

Constructor Details

#initialize(pdf, xml) ⇒ Recipient

Returns a new instance of Recipient.



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

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

Instance Method Details

#renderObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/br_danfe/danfe_lib/nfce_lib/recipient.rb', line 10

def render
  @pdf.render_blank_line

  if identified_recipient?
    render_document

    @pdf.text @xml['dest/xNome'], options
    @pdf.text BrDanfe::DanfeLib::NfceLib::Helper.address(@xml.css('enderDest')), options
  else
    @pdf.text 'CONSUMIDOR NÃO IDENTIFICADO', options
  end
end