Sha256: 09442d9235d02c52630ef9f82e2c5cb300a0dedb02eeecda3aaea1669d2f58cb

Contents?: true

Size: 775 Bytes

Versions: 1

Compression:

Stored size: 775 Bytes

Contents

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 + [: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

    def self.update(member_key, options = {})
      Access::Api.new.member_update member_key, options
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
access-2.0.44 lib/access/member.rb