Class: IPTC::Marker

Inherits:
Object
  • Object
show all
Defined in:
lib/iptc/marker.rb

Overview

Marker

A simple IPTC Marker

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#valueObject

Returns the value of attribute value.



5
6
7
# File 'lib/iptc/marker.rb', line 5

def value
  @value
end

Instance Method Details

#to_binaryObject



13
14
15
# File 'lib/iptc/marker.rb', line 13

def to_binary
    "\x1c\x02"+[@type, @value.length].pack('cn')+@value
end

#to_sObject



10
11
12
# File 'lib/iptc/marker.rb', line 10

def to_s
    self.value
end