lib/access/member.rb in access-2.0.43 vs lib/access/member.rb in access-2.0.44
- old
+ new
@@ -4,13 +4,16 @@
def self.process_batch(chunk)
chunk.map { |member| new(member) }
end
def initialize(values)
- self.class.class_eval {attr_reader *values.keys }
+ 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
+ @user = @user ? Access::User.new(@user) : nil
+ @program = Access::Program.new(@program) if @program
+ @organization = Access::Organization.new(@organization) if @organization
end
def self.show(member_key, options = {})
Access::Api.new.member_show member_key, options
end