Class: PrintNode::Account
- Inherits:
-
Object
- Object
- PrintNode::Account
- Defined in:
- lib/printnode/account.rb
Overview
An object to deal with Account Creation.
Instance Attribute Summary collapse
-
#creator_ref ⇒ Object
Returns the value of attribute creator_ref.
-
#email ⇒ Object
Returns the value of attribute email.
-
#firstname ⇒ Object
Returns the value of attribute firstname.
-
#lastname ⇒ Object
Returns the value of attribute lastname.
-
#password ⇒ Object
Returns the value of attribute password.
Instance Method Summary collapse
-
#initialize(firstname, lastname, email, password) ⇒ Account
constructor
Initialize our object ready for being mapped into a hash.
-
#to_hash ⇒ Object
Map our object into a hash for JSON Encoding.
Constructor Details
#initialize(firstname, lastname, email, password) ⇒ Account
Initialize our object ready for being mapped into a hash.
24 25 26 27 28 29 |
# File 'lib/printnode/account.rb', line 24 def initialize(firstname, lastname, email, password) @firstname = firstname @lastname = lastname @email = email @password = password end |
Instance Attribute Details
#creator_ref ⇒ Object
Returns the value of attribute creator_ref.
10 11 12 |
# File 'lib/printnode/account.rb', line 10 def creator_ref @creator_ref end |
#email ⇒ Object
Returns the value of attribute email.
8 9 10 |
# File 'lib/printnode/account.rb', line 8 def email @email end |
#firstname ⇒ Object
Returns the value of attribute firstname.
6 7 8 |
# File 'lib/printnode/account.rb', line 6 def firstname @firstname end |
#lastname ⇒ Object
Returns the value of attribute lastname.
7 8 9 |
# File 'lib/printnode/account.rb', line 7 def lastname @lastname end |
#password ⇒ Object
Returns the value of attribute password.
9 10 11 |
# File 'lib/printnode/account.rb', line 9 def password @password end |
Instance Method Details
#to_hash ⇒ Object
Map our object into a hash for JSON Encoding.
13 14 15 16 17 18 19 20 21 |
# File 'lib/printnode/account.rb', line 13 def to_hash hash = {} hash['firstname'] = @firstname hash['lastname'] = @lastname hash['email'] = @email hash['password'] = @password hash['creatorRef'] = @creator_ref if @creator_ref hash end |