Class: IPTC::Marker
- Inherits:
-
Object
- Object
- IPTC::Marker
- Defined in:
- lib/iptc/marker.rb
Overview
Marker
A simple IPTC Marker
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(type, value) ⇒ Marker
constructor
A new instance of Marker.
- #to_binary ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(type, value) ⇒ Marker
Returns a new instance of Marker.
6 7 8 9 |
# File 'lib/iptc/marker.rb', line 6 def initialize(type, value) @type = type @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/iptc/marker.rb', line 5 def value @value end |
Instance Method Details
#to_binary ⇒ Object
13 14 15 |
# File 'lib/iptc/marker.rb', line 13 def to_binary "\x1c\x02"+[@type, @value.length].pack('cn')+@value end |
#to_s ⇒ Object
10 11 12 |
# File 'lib/iptc/marker.rb', line 10 def to_s self.value end |