Class: InstanceVariables

Class | InstanceVariables
In: | lib/core/facets/kernel/instance_variables.rb
Parent: | Object

### Methods

<< [] []= each instance_delegate keys names new to_hash update values

### Included Modules

Enumerable

### Public Class methods

new(delegate)

[Source]

    # File lib/core/facets/kernel/instance_variables.rb, line 14
      def initialize(delegate)
        @delegate = delegate
      end

### Public Instance methods

<<(pair)

[Source]

    # 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

[](name)

[Source]

    # File lib/core/facets/kernel/instance_variables.rb, line 36
      def [](name)
        name = atize(name)
        @delegate.instance_variable_get(name)
      end

[]=(name, value)

[Source]

    # File lib/core/facets/kernel/instance_variables.rb, line 41
      def []=(name, value)
        name = atize(name)
        @delegate.instance_varaible_set(name,value)
      end

each() {|name[1..-1].to_sym, @delegate.instance_variable_get(name)| ...}

[Source]

    # 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

instance_delegate()

[Source]

    # File lib/core/facets/kernel/instance_variables.rb, line 18
      def instance_delegate
        @delegate
      end

keys()

[Source]

    # 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

names()

[Source]

    # File lib/core/facets/kernel/instance_variables.rb, line 64
      def names
        @delegate.instance_variables.collect do |name|
          name[1..-1]
        end
      end

to_hash()

[Source]

    # File lib/core/facets/kernel/instance_variables.rb, line 28
      def to_hash
        h = {}
        each do |name, value|
          h[name] = value
        end
        h
      end

update(hash)

[Source]

    # File lib/core/facets/kernel/instance_variables.rb, line 52
      def update(hash)
        hash.each do |pair|
          self << pair
        end
      end

values()

[Source]

    # File lib/core/facets/kernel/instance_variables.rb, line 70
      def values
        @delegate.instance_variables.collect do |name|
          @delegate.instance_variable_get(name)
        end
      end

[Validate]