In: |
yaml/types.rb
|
Parent: | Array |
# File yaml/types.rb, line 73 def self.[]( *vals ) o = Omap.new 0.step( vals.length - 1, 2 ) { |i| o[vals[i]] = vals[i+1] } o end
# File yaml/types.rb, line 83 def []=( k, *rest ) val, set = rest.reverse if ( tmp = self.assoc( k ) ) and not set tmp[1] = val else self << [ k, val ] end val end