Class: AutoOrderedHash
- Inherits:
-
OrderedHash
- Object
- Hash
- OrderedHash
- AutoOrderedHash
- Defined in:
- lib/orderedautohash.rb
Instance Attribute Summary
Attributes inherited from OrderedHash
Instance Method Summary collapse
- #__class__ ⇒ Object
-
#class ⇒ Object
for nice yaml.
-
#initialize(*args) ⇒ AutoOrderedHash
constructor
A new instance of AutoOrderedHash.
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 |
#class ⇒ Object
for nice yaml
10 11 12 |
# File 'lib/orderedautohash.rb', line 10 def class # for nice yaml Hash end |