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

Methods

Public Instance methods

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

[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

[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]