Class: Looks::Gravatar::Address

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/looks/gravatar/address.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email, image) ⇒ Address

Returns a new instance of Address.



17
18
19
20
# File 'lib/looks/gravatar/address.rb', line 17

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

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



15
16
17
# File 'lib/looks/gravatar/address.rb', line 15

def email
  @email
end

#imageObject (readonly)

Returns the value of attribute image.



15
16
17
# File 'lib/looks/gravatar/address.rb', line 15

def image
  @image
end

Class Method Details

.new_from_addresses(key, value) ⇒ Object



8
9
10
11
12
13
# File 'lib/looks/gravatar/address.rb', line 8

def self.new_from_addresses(key, value)
  email = key
  image = Image.new_from_addresses(value)

  new(email, image)
end

Instance Method Details

#<=>(other) ⇒ Object



22
23
24
# File 'lib/looks/gravatar/address.rb', line 22

def <=>(other)
  email <=> other.email
end

#to_sObject



26
27
28
# File 'lib/looks/gravatar/address.rb', line 26

def to_s
  email
end