Class: EideticPDF::PdfObjects::PdfInteger

Inherits:
PdfNumber
  • Object
show all
Defined in:
lib/epdfo.rb

Instance Attribute Summary

Attributes inherited from PdfNumber

#value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PdfNumber

#==, #eql?, #to_s

Constructor Details

#initialize(value) ⇒ PdfInteger

Returns a new instance of PdfInteger.



119
120
121
# File 'lib/epdfo.rb', line 119

def initialize(value)
  @value = value.to_i
end

Class Method Details

.ary(int_ary) ⇒ Object



123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/epdfo.rb', line 123

def self.ary(int_ary)
  p_ary = int_ary.map do |i|
    if i.respond_to?(:to_i)
      PdfInteger.new(i.to_i)
    elsif i.respond_to?(:to_ary)
      PdfInteger.ary(i.to_ary)
    else
      i
    end
  end
  PdfArray.new p_ary
end