Module: HexaPDF::DictionaryFields::RectangleConverter
- Defined in:
- lib/hexapdf/dictionary_fields.rb
Overview
Converter module for fields of type Rectangle.
Class Method Summary collapse
-
.additional_types ⇒ Object
Rectangle fields can also contain simple arrays.
-
.convert(data, _type, document) ⇒ Object
Wraps the given data value in the Rectangle class.
-
.convert?(data, _type) ⇒ Boolean
Returns
true
if the given data value is an Array. -
.usable_for?(type) ⇒ Boolean
This converter is usable if the
type
is Rectangle.
Class Method Details
.additional_types ⇒ Object
Rectangle fields can also contain simple arrays.
360 361 362 |
# File 'lib/hexapdf/dictionary_fields.rb', line 360 def self.additional_types Array end |
.convert(data, _type, document) ⇒ Object
Wraps the given data value in the Rectangle class.
370 371 372 |
# File 'lib/hexapdf/dictionary_fields.rb', line 370 def self.convert(data, _type, document) document.wrap(data, type: Rectangle) end |
.convert?(data, _type) ⇒ Boolean
Returns true
if the given data value is an Array.
365 366 367 |
# File 'lib/hexapdf/dictionary_fields.rb', line 365 def self.convert?(data, _type) data.kind_of?(Array) end |