class Struct

Public Instance Methods

attributes() click to toggle source

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

# 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) click to toggle source
# File lib/core/facets/kernel/object_state.rb, line 49
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) click to toggle source
# File lib/core/facets/kernel/object_state.rb, line 59
def replace(snap)
  snap.each_pair {|k,v| send(k.to_s + "=", v)}
end