Class: Allegro::WebApi::User

Inherits:
Object
  • Object
show all
Defined in:
lib/allegro/webapi/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ User

Returns a new instance of User.



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

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



4
5
6
# File 'lib/allegro/webapi/user.rb', line 4

def client
  @client
end

#my_dataObject (readonly)

Returns the value of attribute my_data.



5
6
7
# File 'lib/allegro/webapi/user.rb', line 5

def my_data
  @my_data
end

Instance Method Details

#addressObject



41
42
43
# File 'lib/allegro/webapi/user.rb', line 41

def address
  my_data[:user_address]
end

#birth_dateObject



37
38
39
# File 'lib/allegro/webapi/user.rb', line 37

def birth_date
  my_data[:user_birth_date]
end

#cityObject



45
46
47
# File 'lib/allegro/webapi/user.rb', line 45

def city
  my_data[:user_city]
end

#companyObject



16
17
18
# File 'lib/allegro/webapi/user.rb', line 16

def company
  my_data[:user_company]
end

#do_get_my_dataObject



11
12
13
14
# File 'lib/allegro/webapi/user.rb', line 11

def do_get_my_data
  @my_data = client.call(:do_get_my_data, message: {session_handle: client.session_handle}).
      body[:do_get_my_data_response][:user_data]
end

#emailObject



28
29
30
# File 'lib/allegro/webapi/user.rb', line 28

def email
  my_data[:user_email]
end

#first_nameObject



49
50
51
# File 'lib/allegro/webapi/user.rb', line 49

def first_name
  my_data[:user_first_name]
end

#idObject



20
21
22
# File 'lib/allegro/webapi/user.rb', line 20

def id
  my_data[:user_id]
end

#last_nameObject



53
54
55
# File 'lib/allegro/webapi/user.rb', line 53

def last_name
  my_data[:user_last_name]
end

#phoneObject



32
33
34
# File 'lib/allegro/webapi/user.rb', line 32

def phone
  my_data[:user_phone]
end

#ratingObject



24
25
26
# File 'lib/allegro/webapi/user.rb', line 24

def rating
  my_data[:user_rating]
end