Class: Colourlovers::Pattern
- Inherits:
-
Object
- Object
- Colourlovers::Pattern
- Defined in:
- lib/colourlovers/pattern.rb
Class Method Summary collapse
-
.all(options) ⇒ Object
Retrieve patterns as an array of hashes with options available from Colourlovers API see documentation here: www.colourlovers.com/api#patterns lover = COLOURlover hueOption = yellow,orange,red or green,violet or blue [Possible Values can be a combination of: red, orange, yellow, green, aqua, blue, violet, and / or fuchsia] hex = 00FF33 [Possible Values: any valid 6-char hex value] keywords = search+term keywordExact = 0 or 1 [Perform an exact search for the keywords passed. Default 0] 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].
-
.find(patternID) ⇒ Object
Retrieve pattern details from patternID.
-
.new(options) ⇒ Object
Retrives patterns as an array of hashes, same options as all but ordered by dateCreated.
-
.random ⇒ Object
Retrieve random pattern as an array with one hash, no parameters allowed.
-
.top(options) ⇒ Object
Retrives patterns as an array of hashes, same options as all but ordered by popularity.
Class Method Details
.all(options) ⇒ Object
Retrieve patterns as an array of hashes with options available from Colourlovers API see documentation here: www.colourlovers.com/api#patterns lover = COLOURlover hueOption = yellow,orange,red or green,violet or blue
- Possible Values can be a combination of: red, orange, yellow, green, aqua, blue, violet, and / or fuchsia
-
hex = 00FF33 [Possible Values: any valid 6-char hex value] keywords = search+term keywordExact = 0 or 1 [Perform an exact search for the keywords passed. Default 0] 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]
19 20 21 |
# File 'lib/colourlovers/pattern.rb', line 19 def all() Client.get("/patterns", :query => ) end |
.find(patternID) ⇒ Object
Retrieve pattern details from patternID
39 40 41 |
# File 'lib/colourlovers/pattern.rb', line 39 def find(patternID) Client.get("/pattern/#{patternID}") end |
.new(options) ⇒ Object
Retrives patterns as an array of hashes, same options as all but ordered by dateCreated
29 30 31 |
# File 'lib/colourlovers/pattern.rb', line 29 def new() Client.get("/patterns/new", :query => ) end |
.random ⇒ Object
Retrieve random pattern as an array with one hash, no parameters allowed
34 35 36 |
# File 'lib/colourlovers/pattern.rb', line 34 def random Client.get("/patterns/random") end |
.top(options) ⇒ Object
Retrives patterns as an array of hashes, same options as all but ordered by popularity
24 25 26 |
# File 'lib/colourlovers/pattern.rb', line 24 def top() Client.get("/patterns/top", :query => ) end |