Class: Traceparts::User
- Inherits:
-
Object
- Object
- Traceparts::User
- Defined in:
- lib/traceparts/user.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
Instance Method Summary collapse
- #exists? ⇒ Boolean
-
#initialize(client, email) ⇒ User
constructor
A new instance of User.
- #register(company, country, first_name = nil, last_name = nil, phone = nil) ⇒ Object
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
#email ⇒ Object (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
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 |