Class: GoApiClient::Domain::User

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, email) ⇒ User

Returns a new instance of User.



6
7
8
9
# File 'lib/go_api_client/domain/user.rb', line 6

def initialize(name, email)
  @name = name
  @email = email
end

Instance Attribute Details

#emailObject

Returns the value of attribute email.



4
5
6
# File 'lib/go_api_client/domain/user.rb', line 4

def email
  @email
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/go_api_client/domain/user.rb', line 4

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



11
12
13
14
15
# File 'lib/go_api_client/domain/user.rb', line 11

def ==(other)
  other && self.class.equal?(other.class) &&
      name == other.name &&
      email == other.email
end

#hashObject



17
18
19
# File 'lib/go_api_client/domain/user.rb', line 17

def hash
  self.class.hash ^ name.hash ^ email.hash
end

#inspectObject



25
26
27
# File 'lib/go_api_client/domain/user.rb', line 25

def inspect
  "User(#{to_s})"
end

#to_sObject



21
22
23
# File 'lib/go_api_client/domain/user.rb', line 21

def to_s
  "#{name} <#{email}>"
end