Class: Traceparts::User

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, email) ⇒ User

Returns a new instance of User.



5
6
7
8
9
# File 'lib/traceparts/user.rb', line 5

def initialize(client, email)
  @client = client

  @email = email
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



3
4
5
# File 'lib/traceparts/user.rb', line 3

def email
  @email
end

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/traceparts/user.rb', line 11

def exists?
  @client.user_exists?(email)
end

#register(company, country, first_name = nil, last_name = nil, phone = nil) ⇒ Object



15
16
17
# File 'lib/traceparts/user.rb', line 15

def register(company, country, first_name = nil, last_name = nil, phone = nil)
  @client.register_user(email, company, country, first_name, last_name, phone)
end