Class Struct
In: lib/core/facets/struct/attributes.rb
lib/core/facets/kernel/object_state.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
4:   def attributes
5:     h = {}
6:     each_pair { |k,v| h[k] = v }
7:     h
8:   end

[Source]

    # File lib/core/facets/kernel/object_state.rb, line 47
47:   def object_state(data=nil)
48:     if data
49:       data.each_pair {|k,v| send(k.to_s + "=", v)}
50:     else
51:       data = {}
52:       each_pair{|k,v| data[k] = v}
53:       data
54:     end
55:   end

[Source]

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

[Validate]