Class: Struct

Class | Struct
In: | lib/core/facets/kernel/object_state.rb lib/core/facets/struct/attributes.rb
Parent: | Object

### Methods

attributes object_state replace

### Public Instance methods

attributes()

Returns a hash containing the names and values for all instance variables in the Struct.

[Source]

    # File lib/core/facets/struct/attributes.rb, line 4
      def attributes
        h = {}
        each_pair { |k,v| h[k] = v }
        h
      end

object_state(data=nil)

[Source]

    # File lib/core/facets/kernel/object_state.rb, line 47
      def object_state(data=nil)
        if data
          data.each_pair {|k,v| send(k.to_s + "=", v)}
        else
          data = {}
          each_pair{|k,v| data[k] = v}
          data
        end
      end

replace(snap)

[Source]

    # File lib/core/facets/kernel/object_state.rb, line 57
      def replace(snap)
        snap.each_pair {|k,v| send(k.to_s + "=", v)}
      end

[Validate]