Class: Bananajour::Bonjour::Person

Inherits:
Object
  • Object
show all
Defined in:
lib/bananajour/bonjour/person.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, email, uri, gravatar) ⇒ Person

Returns a new instance of Person.



5
6
7
# File 'lib/bananajour/bonjour/person.rb', line 5

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

Instance Attribute Details

#emailObject

Returns the value of attribute email.



3
4
5
# File 'lib/bananajour/bonjour/person.rb', line 3

def email
  @email
end

#gravatarObject

Returns the value of attribute gravatar.



3
4
5
# File 'lib/bananajour/bonjour/person.rb', line 3

def gravatar
  @gravatar
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/bananajour/bonjour/person.rb', line 3

def name
  @name
end

#uriObject

Returns the value of attribute uri.



3
4
5
# File 'lib/bananajour/bonjour/person.rb', line 3

def uri
  @uri
end

Instance Method Details

#==(other) ⇒ Object



9
10
11
# File 'lib/bananajour/bonjour/person.rb', line 9

def ==(other)
  self.uri == other.uri
end

#hashObject



13
14
15
# File 'lib/bananajour/bonjour/person.rb', line 13

def hash
  to_hash.hash
end

#to_hashObject



17
18
19
# File 'lib/bananajour/bonjour/person.rb', line 17

def to_hash
  {"name" => name, "email" => email, "uri" => uri, "gravatar" => gravatar}
end