class Ole::Types::PropertySet::Section

Constants

PACK
SIZE

Attributes

guid[RW]
length[R]
offset[RW]

Public Class Methods

new(str, property_set) click to toggle source
# File lib/ole/types/property_set.rb, line 51
def initialize str, property_set
  @property_set = property_set
  @guid, @offset = str.unpack PACK
  self.guid = Clsid.load guid
  load_header
end

Public Instance Methods

[](key) click to toggle source
# File lib/ole/types/property_set.rb, line 67
def [] key
  each_raw do |id, property_offset|
    return read_property(property_offset).last if key == id
  end
  nil
end
[]=(key, value) click to toggle source
# File lib/ole/types/property_set.rb, line 74
def []= key, value
  raise NotImplementedError, 'section writes not yet implemented'
end
each() { |id, read_property(property_offset).last| ... } click to toggle source
# File lib/ole/types/property_set.rb, line 78
def each
  each_raw do |id, property_offset|
    yield id, read_property(property_offset).last
  end
end
io() click to toggle source
# File lib/ole/types/property_set.rb, line 58
def io
  @property_set.io
end
load_header() click to toggle source
# File lib/ole/types/property_set.rb, line 62
def load_header
  io.seek offset
  @byte_size, @length = io.read(8).unpack 'V2'
end