Class: ALib::AutoOrderedHash

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

Overview

auto vivifying ordered hash that dumps as yaml nicely

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, #inspect, #invert, #keys, #merge, #orig_store, #pop, #push, #reject, #reject!, #replace, #select, #shift, #store, #store_only, #to_a, #to_s, #unshift, #update, #values, #yaml_inline!, #yaml_inline=

Methods inherited from Hash

#getopt, #hasopt?

Constructor Details

#initialize(*args) ⇒ AutoOrderedHash

–{{{



6
7
8
9
10
# File 'lib/alib-0.5.1/orderedautohash.rb', line 6

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

Instance Method Details

#__class__Object

–}}}



16
17
18
19
20
# File 'lib/alib-0.5.1/orderedautohash.rb', line 16

def __class__
#--{{{
  ALib::AutoOrderedHash
#--}}}
end

#classObject

–}}}



11
12
13
14
15
# File 'lib/alib-0.5.1/orderedautohash.rb', line 11

def class # for nice yaml
#--{{{
  Hash
#--}}}
end