Class: EideticPDF::PdfObjects::PdfArray
- Inherits:
-
Object
- Object
- EideticPDF::PdfObjects::PdfArray
- Includes:
- Enumerable
- Defined in:
- lib/epdfo.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
Returns the value of attribute values.
-
#wrap ⇒ Object
Returns the value of attribute wrap.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #each ⇒ Object
- #eql?(other) ⇒ Boolean
-
#initialize(values = [], wrap = 0) ⇒ PdfArray
constructor
A new instance of PdfArray.
- #to_s ⇒ Object
Constructor Details
#initialize(values = [], wrap = 0) ⇒ PdfArray
Returns a new instance of PdfArray.
243 244 245 |
# File 'lib/epdfo.rb', line 243 def initialize(values=[], wrap=0) @values, @wrap = values, wrap end |
Instance Attribute Details
#values ⇒ Object (readonly)
Returns the value of attribute values.
240 241 242 |
# File 'lib/epdfo.rb', line 240 def values @values end |
#wrap ⇒ Object
Returns the value of attribute wrap.
241 242 243 |
# File 'lib/epdfo.rb', line 241 def wrap @wrap end |
Instance Method Details
#==(other) ⇒ Object
263 264 265 266 |
# File 'lib/epdfo.rb', line 263 def ==(other) (other.respond_to?(:values) && self.values == other.values) && (other.respond_to?(:wrap) && self.wrap == other.wrap) end |
#each ⇒ Object
251 252 253 254 255 256 257 |
# File 'lib/epdfo.rb', line 251 def each if wrap.zero? yield values else 0.step(values.size, wrap) { |i| yield values[i, wrap] } end end |
#eql?(other) ⇒ Boolean
259 260 261 |
# File 'lib/epdfo.rb', line 259 def eql?(other) self.values.eql?(other.values) && self.wrap.eql?(other.wrap) end |
#to_s ⇒ Object
247 248 249 |
# File 'lib/epdfo.rb', line 247 def to_s "[#{wrapped_values}] " end |