Class: Colourlovers::Lover

Inherits:
Object
  • Object
show all
Defined in:
lib/colourlovers/lover.rb

Class Method Summary collapse

Class Method Details

.all(options) ⇒ Object

Retrieve lovers as an array of hashes with options available from Colourlovers API see documentation here: www.colourlovers.com/api#lovers orderCol = X [Where X can be: dateCreated, score, name, numVotes, or numViews] sortBy = X [Where X can be: ASC or DESC. Default ASC] numResults = 20 [Number of results to return, maximum of 100. Default 20] resultOffset = 5 [Result offset, for paging. Default 0]



13
14
15
# File 'lib/colourlovers/lover.rb', line 13

def all(options)  
  Client.get("/lovers", :query => options)
end

.find(username) ⇒ Object

Retrieve lover details from username as an array with one hash



28
29
30
# File 'lib/colourlovers/lover.rb', line 28

def find(username)
  Client.get("/lover/#{username}")
end

.new(options) ⇒ Object

Retrives lovers as an array of hashes, same options as all but ordered by dateCreated



23
24
25
# File 'lib/colourlovers/lover.rb', line 23

def new(options)  
  Client.get("/lovers/new", :query => options)
end

.top(options) ⇒ Object

Retrives lovers as an array of hashes, same options as all but ordered by popularity



18
19
20
# File 'lib/colourlovers/lover.rb', line 18

def top(options)  
  Client.get("/lovers/top", :query => options)
end