Class: Ole::Types::PropertySet::Section
- Inherits:
-
Object
- Object
- Ole::Types::PropertySet::Section
- Includes:
- Enumerable, Variant::Constants
- Defined in:
- lib/ole/types/property_set.rb
Constant Summary collapse
Constants included from Variant::Constants
Variant::Constants::VT_TYPEMASK
Instance Attribute Summary collapse
-
#guid ⇒ Object
Returns the value of attribute guid.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#offset ⇒ Object
Returns the value of attribute offset.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #each ⇒ Object
-
#initialize(str, property_set) ⇒ Section
constructor
A new instance of Section.
- #io ⇒ Object
- #load_header ⇒ Object
Methods included from Enumerable
Constructor Details
Instance Attribute Details
#guid ⇒ Object
Returns the value of attribute guid.
84 85 86 |
# File 'lib/ole/types/property_set.rb', line 84 def guid @guid end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
85 86 87 |
# File 'lib/ole/types/property_set.rb', line 85 def length @length end |
#offset ⇒ Object
Returns the value of attribute offset.
84 85 86 |
# File 'lib/ole/types/property_set.rb', line 84 def offset @offset end |
Instance Method Details
#[](key) ⇒ Object
103 104 105 106 107 108 |
# File 'lib/ole/types/property_set.rb', line 103 def [] key each_raw do |id, property_offset| return read_property(property_offset).last if key == id end nil end |
#[]=(key, value) ⇒ Object
110 111 112 |
# File 'lib/ole/types/property_set.rb', line 110 def []= key, value raise NotImplementedError, 'section writes not yet implemented' end |
#each ⇒ Object
114 115 116 117 118 |
# File 'lib/ole/types/property_set.rb', line 114 def each each_raw do |id, property_offset| yield id, read_property(property_offset).last end end |
#io ⇒ Object
94 95 96 |
# File 'lib/ole/types/property_set.rb', line 94 def io @property_set.io end |
#load_header ⇒ Object
98 99 100 101 |
# File 'lib/ole/types/property_set.rb', line 98 def load_header io.seek offset @byte_size, @length = io.read(8).unpack 'V2' end |