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
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.
48 49 50 |
# File 'lib/ole/types/property_set.rb', line 48 def guid @guid end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
49 50 51 |
# File 'lib/ole/types/property_set.rb', line 49 def length @length end |
#offset ⇒ Object
Returns the value of attribute offset.
48 49 50 |
# File 'lib/ole/types/property_set.rb', line 48 def offset @offset end |
Instance Method Details
#[](key) ⇒ Object
67 68 69 70 71 72 |
# 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) ⇒ Object
74 75 76 |
# File 'lib/ole/types/property_set.rb', line 74 def []= key, value raise NotImplementedError, 'section writes not yet implemented' end |
#each ⇒ Object
78 79 80 81 82 |
# 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 ⇒ Object
58 59 60 |
# File 'lib/ole/types/property_set.rb', line 58 def io @property_set.io end |
#load_header ⇒ Object
62 63 64 65 |
# File 'lib/ole/types/property_set.rb', line 62 def load_header io.seek offset @byte_size, @length = io.read(8).unpack 'V2' end |