Class: BrDanfe::CceLib::Barcode
- Inherits:
-
Object
- Object
- BrDanfe::CceLib::Barcode
- Defined in:
- lib/br_danfe/cce_lib/barcode.rb
Instance Method Summary collapse
-
#initialize(pdf, xml) ⇒ Barcode
constructor
A new instance of Barcode.
- #render ⇒ Object
Constructor Details
#initialize(pdf, xml) ⇒ Barcode
Returns a new instance of Barcode.
4 5 6 7 |
# File 'lib/br_danfe/cce_lib/barcode.rb', line 4 def initialize(pdf, xml) @pdf = pdf @xml = Nokogiri::XML(xml) end |
Instance Method Details
#render ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/br_danfe/cce_lib/barcode.rb', line 9 def render @pdf.box(height: 50) do @pdf.move_down 40 = Barby::Code128C.new(nfe_key) .annotate_pdf(@pdf, x: @pdf.cursor, y: @pdf.cursor, height: 40) end end |