Class: IPTCR::IPTC
- Inherits:
-
Object
- Object
- IPTCR::IPTC
- Defined in:
- lib/iptcr/iptc.rb
Overview
# IPTC
## Notes
IPTC metadata is a series of records. Records contain datasets. Each dataset contains a data field, which is a particular value for that dataset. Repeated datasets represent mulitple fields for the same dataset, like for list data.
## References
Defined Under Namespace
Classes: Field
Constant Summary collapse
- DEFAULT_ENCODING =
IPTC IIM specifics the default encoding is ISO646/4873, which is roughly ASCII
Encoding::ASCII
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
Instance Method Summary collapse
- #[](name) ⇒ Object
- #encoding ⇒ Object
-
#initialize(io, length:) ⇒ IPTC
constructor
A new instance of IPTC.
- #to_hash ⇒ Object
Constructor Details
#initialize(io, length:) ⇒ IPTC
Returns a new instance of IPTC.
27 28 29 30 |
# File 'lib/iptcr/iptc.rb', line 27 def initialize(io, length:) @fields = [] read_fields(io, length: length) end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
22 23 24 |
# File 'lib/iptcr/iptc.rb', line 22 def fields @fields end |
Instance Method Details
#[](name) ⇒ Object
36 37 38 |
# File 'lib/iptcr/iptc.rb', line 36 def [](name) field_values[name] end |
#encoding ⇒ Object
32 33 34 |
# File 'lib/iptcr/iptc.rb', line 32 def encoding @encoding || DEFAULT_ENCODING end |
#to_hash ⇒ Object
40 41 42 |
# File 'lib/iptcr/iptc.rb', line 40 def to_hash field_values end |