Class: Struct
Instance Method Summary collapse
Instance Method Details
#attributes ⇒ Object
5 6 7 |
# File 'lib/lite/ruby/struct.rb', line 5 def attributes each_pair.with_object({}) { |(key, val), hash| hash[key] = val } end |
#replace(args) ⇒ Object
9 10 11 |
# File 'lib/lite/ruby/struct.rb', line 9 def replace(args) args.each_pair { |key, val| self[key] = val } end |