Class Stash
In: lib/more/facets/stash.rb
Parent: Hash

Hash

Stash is just like Hash, except that all keys are converted to Strings.

This is rather fresh code, so is not yet complete. For instnace, it currently does not ensure that default keys are strings when using default_proc.

Methods

<<   []   []=   fetch   has_key?   key?   store  

Public Instance methods

[Source]

    # File lib/more/facets/stash.rb, line 38
38:   def <<(other)
39:     cash other
40:     when Hash
41:       super(other.rekey(&:to_s))
42:     when Array
43:       self[other[0].to_s] = other[1]
44:     else
45:       raise ArgumentError
46:     end

[Source]

    # File lib/more/facets/stash.rb, line 30
30:   def [](k)
31:     super(k.to_s)
32:   end

[Source]

    # File lib/more/facets/stash.rb, line 34
34:   def []=(k,v)
35:     super(k.to_s, v)
36:   end

[Source]

    # File lib/more/facets/stash.rb, line 14
14:   def fetch(k)
15:     super(k.to_s)
16:   end

[Source]

    # File lib/more/facets/stash.rb, line 22
22:   def has_key?(k)
23:     super(k.to_s)
24:   end

[Source]

    # File lib/more/facets/stash.rb, line 26
26:   def key?(k)
27:     super(k.to_s)
28:   end

[Source]

    # File lib/more/facets/stash.rb, line 18
18:   def store(k, v)
19:     super(k.to_s, v)
20:   end

[Validate]