Class: PrintNode::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/printnode/account.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(firstname, lastname, email, password) ⇒ Account

Returns a new instance of Account.



19
20
21
22
23
24
# File 'lib/printnode/account.rb', line 19

def initialize(firstname, lastname, email, password)
  @firstname = firstname
  @lastname = lastname
  @email = email
  @password = password
end

Instance Attribute Details

#creator_refObject

Returns the value of attribute creator_ref.



7
8
9
# File 'lib/printnode/account.rb', line 7

def creator_ref
  @creator_ref
end

#emailObject

Returns the value of attribute email.



5
6
7
# File 'lib/printnode/account.rb', line 5

def email
  @email
end

#firstnameObject

Returns the value of attribute firstname.



3
4
5
# File 'lib/printnode/account.rb', line 3

def firstname
  @firstname
end

#lastnameObject

Returns the value of attribute lastname.



4
5
6
# File 'lib/printnode/account.rb', line 4

def lastname
  @lastname
end

#passwordObject

Returns the value of attribute password.



6
7
8
# File 'lib/printnode/account.rb', line 6

def password
  @password
end

Instance Method Details

#to_hashObject



9
10
11
12
13
14
15
16
17
# File 'lib/printnode/account.rb', line 9

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