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.
29 30 31 32 33 |
# File 'lib/looks/gravatar/image.rb', line 29 def initialize(id, url, ) @id = id @url = url @rating = end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
27 28 29 |
# File 'lib/looks/gravatar/image.rb', line 27 def id @id end |
#rating ⇒ Object
Returns the value of attribute rating.
27 28 29 |
# File 'lib/looks/gravatar/image.rb', line 27 def @rating end |
#url ⇒ Object
Returns the value of attribute url.
27 28 29 |
# File 'lib/looks/gravatar/image.rb', line 27 def url @url end |
Class Method Details
.new_from_addresses(value) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/looks/gravatar/image.rb', line 6 def self.new_from_addresses(value) id = value['userimage'] if not id.empty? url = value['userimage_url'] = value['rating'] new(id, url, ) else nil end end |
.new_from_images(key, value) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/looks/gravatar/image.rb', line 19 def self.new_from_images(key, value) id = key url = value[1] = value[0] new(id, url, ) end |
Instance Method Details
#<=>(other) ⇒ Object
35 36 37 |
# File 'lib/looks/gravatar/image.rb', line 35 def <=>(other) id <=> other.id end |
#to_s ⇒ Object
39 40 41 |
# File 'lib/looks/gravatar/image.rb', line 39 def to_s id end |