Class: BrDanfe::DanfeLib::NfeLib::Dup
- Inherits:
-
Object
- Object
- BrDanfe::DanfeLib::NfeLib::Dup
- Defined in:
- lib/br_danfe/danfe_lib/nfe_lib/dup.rb
Constant Summary collapse
- Y_POSITION =
12.92
Instance Attribute Summary collapse
-
#y_position ⇒ Object
readonly
Returns the value of attribute y_position.
Instance Method Summary collapse
-
#initialize(pdf, xml) ⇒ Dup
constructor
A new instance of Dup.
- #render ⇒ Object
Constructor Details
#initialize(pdf, xml) ⇒ Dup
Returns a new instance of Dup.
9 10 11 12 13 14 15 16 |
# File 'lib/br_danfe/danfe_lib/nfe_lib/dup.rb', line 9 def initialize(pdf, xml) @pdf = pdf @xml = xml @y_position = Entrega.delivery_local?(@xml) ? Y_POSITION + 3.00 : Y_POSITION @ltitle = @y_position - 0.42 end |
Instance Attribute Details
#y_position ⇒ Object (readonly)
Returns the value of attribute y_position.
5 6 7 |
# File 'lib/br_danfe/danfe_lib/nfe_lib/dup.rb', line 5 def y_position @y_position end |
Instance Method Details
#render ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/br_danfe/danfe_lib/nfe_lib/dup.rb', line 18 def render @pdf.ititle 0.42, 10.00, 0.75, @ltitle, 'dup.title' @pdf.ibox 0.85, 19.57, 0.75, @y_position x = 0.75 y = @y_position @xml.collect('xmlns', 'dup') do |det| render_dup(det, x, y) x += 2.30 end end |