Class: AutoOrderedHash

Inherits:
OrderedHash show all
Defined in:
lib/orderedautohash.rb

Instance Attribute Summary

Attributes inherited from OrderedHash

#order, #to_yaml_style

Instance Method Summary collapse

Methods inherited from OrderedHash

#==, [], #clear, #delete, #delete_if, #each, #each_key, #each_value, #each_with_index, #first, #inspect, #invert, #keys, #last, #merge, #orig_store, #pop, #push, #reject, #reject!, #replace, #select, #shift, #store, #store_only, #to_a, #to_s, #unshift, #update, #values, #yaml_inline!, #yaml_inline=

Constructor Details

#initialize(*args) ⇒ AutoOrderedHash

Returns a new instance of AutoOrderedHash.



7
8
9
# File 'lib/orderedautohash.rb', line 7

def initialize(*args)
  super(*args){|a,k| a[k] = __class__.new(*args)}
end

Instance Method Details

#__class__Object



13
14
15
# File 'lib/orderedautohash.rb', line 13

def __class__
  AutoOrderedHash
end

#classObject

for nice yaml



10
11
12
# File 'lib/orderedautohash.rb', line 10

def class # for nice yaml
  Hash
end