Class | InstanceVariables |
In: |
lib/core/facets/kernel/instance_variables.rb
|
Parent: | Object |
# File lib/core/facets/kernel/instance_variables.rb, line 14 def initialize(delegate) @delegate = delegate end
# File lib/core/facets/kernel/instance_variables.rb, line 46 def <<(pair) name, value = *pair name = atize(name) @delegate.instance_varaible_set(name, value) end
# File lib/core/facets/kernel/instance_variables.rb, line 36 def [](name) name = atize(name) @delegate.instance_variable_get(name) end
# File lib/core/facets/kernel/instance_variables.rb, line 41 def []=(name, value) name = atize(name) @delegate.instance_varaible_set(name,value) end
# File lib/core/facets/kernel/instance_variables.rb, line 22 def each @delegate.instance_variables.each do |name| yield(name[1..-1].to_sym, @delegate.instance_variable_get(name)) end end
# File lib/core/facets/kernel/instance_variables.rb, line 58 def keys @delegate.instance_variables.collect do |name| name[1..-1].to_sym end end
# File lib/core/facets/kernel/instance_variables.rb, line 64 def names @delegate.instance_variables.collect do |name| name[1..-1] end end
# File lib/core/facets/kernel/instance_variables.rb, line 28 def to_hash h = {} each do |name, value| h[name] = value end h end