lib/access/member.rb in access-1.1.7 vs lib/access/member.rb in access-2.0.0
- old
+ new
@@ -1,5 +1,16 @@
module Access
class Member
+ def self.process_batch(chunk)
+ chunk.map { |member| new(member) }
+ end
+
+ def initialize(values)
+ self.class.class_eval {attr_reader *values.keys }
+ values.each do |attribute_name, attribute_value|
+ self.instance_variable_set("@#{attribute_name}", attribute_value)
+ end
+ end
+
end
end