Class: TSparser::ExtendedEventDescriptor::ItemHash

Inherits:
Object
  • Object
show all
Defined in:
lib/definition/descriptor/extended_event_descriptor.rb

Defined Under Namespace

Classes: Item

Instance Method Summary collapse

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_hObject



31
32
33
# File 'lib/definition/descriptor/extended_event_descriptor.rb', line 31

def to_h
  return @item_map.dup
end

#to_sObject



35
36
37
# File 'lib/definition/descriptor/extended_event_descriptor.rb', line 35

def to_s
  return @item_map.to_s
end