Returns a hash containing the names and values for all instance settings in the Struct.
This will eventually be deprecated in favor of to_h.
# File lib/facets/struct/attributes.rb, line 8 def attributes h = {} each_pair { |k,v| h[k] = v } h end
# File lib/facets/object/object_state.rb, line 68 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
Struct#replace can take any source that responds to each_pair.
# File lib/facets/object/replace.rb, line 39 def replace(source) source.each_pair{ |k,v| send(k.to_s + "=", v) } end
Generated with the Darkfish Rdoc Generator 2.