Class Command::DecoratingHash
In: lib/command/decoratinghash.rb
Parent: Hash

Methods

keys   length   new   size  

External Aliases

size -> own_size
own_size -> own_length

Attributes

target  [RW] 

Public Class methods

[Source]

    # File lib/command/decoratinghash.rb, line 13
13:     def self.new(target)
14:       obj = super() do |h,k| h.target && h.target[k] end
15:       obj.target = target
16:       obj
17:     end

Public Instance methods

[Source]

    # File lib/command/decoratinghash.rb, line 27
27:     def keys
28:       @target ? (super | @target.keys) : super
29:     end
length()

Alias for size

[Source]

    # File lib/command/decoratinghash.rb, line 22
22:     def size
23:       @target ? keys.size : super
24:     end

[Validate]