Class: Looks::Gravatar::Image
- Inherits:
-
Object
- Object
- Looks::Gravatar::Image
- Includes:
- Comparable
- Defined in:
- lib/looks/gravatar/image.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#rating ⇒ Object
Returns the value of attribute rating.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(id, url, rating) ⇒ Image
constructor
A new instance of Image.
- #to_s ⇒ Object
Constructor Details
#initialize(id, url, rating) ⇒ Image
Returns a new instance of Image.
24 25 26 27 28 |
# File 'lib/looks/gravatar/image.rb', line 24 def initialize(id, url, ) @id = id @url = url @rating = end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
22 23 24 |
# File 'lib/looks/gravatar/image.rb', line 22 def id @id end |
#rating ⇒ Object
Returns the value of attribute rating.
22 23 24 |
# File 'lib/looks/gravatar/image.rb', line 22 def @rating end |
#url ⇒ Object
Returns the value of attribute url.
22 23 24 |
# File 'lib/looks/gravatar/image.rb', line 22 def url @url end |
Class Method Details
.new_from_addresses(value) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/looks/gravatar/image.rb', line 6 def self.new_from_addresses(value) id = value['userimage'] url = value['userimage_url'] = value['rating'] new(id, url, ) end |
.new_from_images(key, value) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/looks/gravatar/image.rb', line 14 def self.new_from_images(key, value) id = key url = value[1] = value[0] new(id, url, ) end |
Instance Method Details
#<=>(other) ⇒ Object
30 31 32 |
# File 'lib/looks/gravatar/image.rb', line 30 def <=>(other) id <=> other.id end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/looks/gravatar/image.rb', line 34 def to_s id end |