Class: ACTV::User

Inherits:
Identity show all
Defined in:
lib/actv/user.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Identity

#==, #id, #initialize

Methods inherited from Base

#[], attr_reader, define_attribute_method, define_predicate_method, define_uri_method, #delete, from_response, #initialize, #memoize, #method_missing, object_attr_reader, #respond_to?, #to_hash, #update, uri_attr_reader

Constructor Details

This class inherits a constructor from ACTV::Identity

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ACTV::Base

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



10
11
12
# File 'lib/actv/user.rb', line 10

def access_token
  @access_token
end

#created_dateObject (readonly)

Returns the value of attribute created_date.



7
8
9
# File 'lib/actv/user.rb', line 7

def created_date
  @created_date
end

#date_of_birthObject (readonly) Also known as: dob

Returns the value of attribute date_of_birth.



7
8
9
# File 'lib/actv/user.rb', line 7

def date_of_birth
  @date_of_birth
end

#display_nameObject (readonly)

Returns the value of attribute display_name.



7
8
9
# File 'lib/actv/user.rb', line 7

def display_name
  @display_name
end

#emailObject (readonly)

Returns the value of attribute email.



7
8
9
# File 'lib/actv/user.rb', line 7

def email
  @email
end

#first_nameObject (readonly)

Returns the value of attribute first_name.



7
8
9
# File 'lib/actv/user.rb', line 7

def first_name
  @first_name
end

#genderObject (readonly)

Returns the value of attribute gender.



7
8
9
# File 'lib/actv/user.rb', line 7

def gender
  @gender
end

#last_nameObject (readonly)

Returns the value of attribute last_name.



7
8
9
# File 'lib/actv/user.rb', line 7

def last_name
  @last_name
end

#middle_nameObject (readonly)

Returns the value of attribute middle_name.



7
8
9
# File 'lib/actv/user.rb', line 7

def middle_name
  @middle_name
end

#user_nameObject (readonly)

Returns the value of attribute user_name.



7
8
9
# File 'lib/actv/user.rb', line 7

def user_name
  @user_name
end

Instance Method Details

#addressObject



29
30
31
# File 'lib/actv/user.rb', line 29

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

#advantage_memberObject Also known as: is_advantage_member?



14
15
16
17
18
19
# File 'lib/actv/user.rb', line 14

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

#avatar_urlObject



22
23
24
25
26
27
# File 'lib/actv/user.rb', line 22

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

#phone_numberObject



33
34
35
# File 'lib/actv/user.rb', line 33

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