lib/access/member.rb in access-2.0.50 vs lib/access/member.rb in access-2.0.51
- old
+ new
@@ -1,16 +1,16 @@
module Access
class Member
+ include Access::MuchMeta
def self.process_batch(chunk)
chunk.map { |member| new(member) }
end
def initialize(values)
- self.class.class_eval {attr_reader *values.keys + [:user] }
- values.each do |attribute_name, attribute_value|
- self.instance_variable_set("@#{attribute_name}", attribute_value)
- end
+ @used_fields = []
+ set_up_methods(values)
+ set_values(values)
@user = Access::User.new(@user) if @user
@member = Access::Member.new(@member.tap {|m| m.delete(:user) }) if @member
@program = Access::Program.new(@program) if @program
@organization = Access::Organization.new(@organization) if @organization
end