Class: TSparser::ExtendedEventDescriptor::ItemHash
- Inherits:
-
Object
- Object
- TSparser::ExtendedEventDescriptor::ItemHash
- Defined in:
- lib/definition/descriptor/extended_event_descriptor.rb
Defined Under Namespace
Classes: Item
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(binary) ⇒ ItemHash
constructor
A new instance of ItemHash.
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(binary) ⇒ ItemHash
Returns a new instance of ItemHash.
19 20 21 22 23 24 25 |
# File 'lib/definition/descriptor/extended_event_descriptor.rb', line 19 def initialize(binary) @item_map = Hash.new while binary.readable? item = Item.new(binary) @item_map[item.item_description.to_utf_8] = item.item.to_utf_8 end end |
Instance Method Details
#[](key) ⇒ Object
27 28 29 |
# File 'lib/definition/descriptor/extended_event_descriptor.rb', line 27 def [](key) return @item_map[key] end |
#to_h ⇒ Object
31 32 33 |
# File 'lib/definition/descriptor/extended_event_descriptor.rb', line 31 def to_h return @item_map.dup end |
#to_s ⇒ Object
35 36 37 |
# File 'lib/definition/descriptor/extended_event_descriptor.rb', line 35 def to_s return @item_map.to_s end |