class Looks::Gravatar::Image

Attributes

id[RW]
rating[RW]
url[RW]

Public Class Methods

new(id, url, rating) click to toggle source
# File lib/looks/gravatar/image.rb, line 29
def initialize(id, url, rating)
  @id     = id
  @url    = url
  @rating = rating
end
new_from_addresses(value) click to toggle source
# 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']
    rating = value['rating']

    new(id, url, rating)
  else
    nil
  end
end
new_from_images(key, value) click to toggle source
# File lib/looks/gravatar/image.rb, line 19
def self.new_from_images(key, value)
  id     = key
  url    = value[1]
  rating = value[0]

  new(id, url, rating)
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/looks/gravatar/image.rb, line 35
def <=>(other)
  id <=> other.id
end
to_s() click to toggle source
# File lib/looks/gravatar/image.rb, line 39
def to_s
  id
end