Class: FlameChannelParser::Inspector::OH

Inherits:
Hash
  • Object
show all
Defined in:
lib/inspector.rb

Overview

It sucks to be Ruby 1.8-compatible sometimes.

Instance Method Summary collapse

Constructor Details

#initializeOH

Returns a new instance of OH.



18
19
20
21
# File 'lib/inspector.rb', line 18

def initialize
  super
  @keys_in_order = []
end

Instance Method Details

#[]=(k, v) ⇒ Object



23
24
25
26
27
# File 'lib/inspector.rb', line 23

def []=(k, v)
  @keys_in_order.delete(k)
  @keys_in_order << k
  super(k, v)
end

#each_pairObject



29
30
31
# File 'lib/inspector.rb', line 29

def each_pair
  @keys_in_order.each {|k| yield(k, self[k]) }
end