Sha256: 02f11d6ffbfc8013341d1ad0d7867be5e1533ff4881021dc80d92a0257b75322

Contents?: true

Size: 922 Bytes

Versions: 50

Compression:

Stored size: 922 Bytes

Contents

require 'actv/address'
require 'actv/phone_number'

module ACTV
  class User < ACTV::Identity

    attr_reader :first_name, :last_name, :middle_name, :gender,
      :display_name, :date_of_birth, :email, :user_name, :created_date

    attr_accessor :access_token

    alias dob date_of_birth

    def advantage_member
      @is_member ||= begin
        client= ACTV::Client.new({ oauth_token: @access_token })
        client.is_advantage_member?
      end
    end
    alias is_advantage_member? advantage_member

    def avatar_url
      @avatar_url ||= begin
        client= ACTV::Client.new({ oauth_token: @access_token })
        client.avatar_url
      end
    end

    def address
      @address ||= ACTV::Address.new(@attrs[:address]) unless @attrs[:address].nil?
    end

    def phone_number
      @phone_number ||= ACTV::PhoneNumber.new(@attrs[:phone_number]) unless @attrs[:phone_number].nil?
    end

  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
actv-2.10.9 lib/actv/user.rb
actv-2.10.8 lib/actv/user.rb
actv-2.10.7 lib/actv/user.rb
actv-2.10.6 lib/actv/user.rb
actv-2.10.5 lib/actv/user.rb
actv-2.10.4 lib/actv/user.rb
actv-2.10.3 lib/actv/user.rb
actv-2.10.2 lib/actv/user.rb
actv-2.10.1 lib/actv/user.rb
actv-2.10.0 lib/actv/user.rb
actv-2.9.2 lib/actv/user.rb
actv-2.9.1 lib/actv/user.rb
actv-2.9.0 lib/actv/user.rb
actv-2.8.2 lib/actv/user.rb
actv-2.8.1 lib/actv/user.rb
actv-2.7.0 lib/actv/user.rb
actv-2.6.0 lib/actv/user.rb
actv-2.5.2 lib/actv/user.rb
actv-2.5.1 lib/actv/user.rb
actv-2.5.0 lib/actv/user.rb