Class: DataGenerator::Gen::User
- Inherits:
-
Object
- Object
- DataGenerator::Gen::User
- Defined in:
- lib/howitzer/utils/data_generator/gen.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#full_name ⇒ Object
readonly
Returns the value of attribute full_name.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
-
#login ⇒ Object
readonly
Returns the value of attribute login.
-
#mailbox ⇒ Object
readonly
Returns the value of attribute mailbox.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
Instance Method Summary collapse
- #create_mailbox ⇒ Object
- #delete_mailbox ⇒ Object
-
#initialize(params = {}) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(params = {}) ⇒ User
Returns a new instance of User.
110 111 112 113 114 115 116 117 118 119 |
# File 'lib/howitzer/utils/data_generator/gen.rb', line 110 def initialize(params={}) @email = params.delete(:email) @email_name, @domain = @email.to_s.split('@') @login = params.delete(:login) || @email_name @password = params.delete(:password) @first_name = params.delete(:first_name) @last_name = params.delete(:last_name) @full_name = "#@first_name #@last_name" @mailbox = params.delete(:mailbox) end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
108 109 110 |
# File 'lib/howitzer/utils/data_generator/gen.rb', line 108 def domain @domain end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
108 109 110 |
# File 'lib/howitzer/utils/data_generator/gen.rb', line 108 def email @email end |
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
108 109 110 |
# File 'lib/howitzer/utils/data_generator/gen.rb', line 108 def first_name @first_name end |
#full_name ⇒ Object (readonly)
Returns the value of attribute full_name.
108 109 110 |
# File 'lib/howitzer/utils/data_generator/gen.rb', line 108 def full_name @full_name end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
108 109 110 |
# File 'lib/howitzer/utils/data_generator/gen.rb', line 108 def last_name @last_name end |
#login ⇒ Object (readonly)
Returns the value of attribute login.
108 109 110 |
# File 'lib/howitzer/utils/data_generator/gen.rb', line 108 def login @login end |
#mailbox ⇒ Object (readonly)
Returns the value of attribute mailbox.
108 109 110 |
# File 'lib/howitzer/utils/data_generator/gen.rb', line 108 def mailbox @mailbox end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
108 109 110 |
# File 'lib/howitzer/utils/data_generator/gen.rb', line 108 def password @password end |
Instance Method Details
#create_mailbox ⇒ Object
121 122 123 124 |
# File 'lib/howitzer/utils/data_generator/gen.rb', line 121 def create_mailbox @mailbox = MailClient.create_mailbox(@email_name) if settings.mail_pop3_domain == @domain self end |
#delete_mailbox ⇒ Object
126 127 128 |
# File 'lib/howitzer/utils/data_generator/gen.rb', line 126 def delete_mailbox MailClient.delete_mailbox(@mailbox) unless @mailbox.nil? end |