Class: Imgur::Client::Images
- Inherits:
-
Cistern::Collection
- Object
- Cistern::Collection
- Imgur::Client::Images
- Includes:
- Imgur::Collection, PagedCollection
- Defined in:
- lib/imgur/models/images.rb
Instance Method Summary collapse
Methods included from Imgur::Collection
#get, included, #model_request, #model_root
Methods included from PagedCollection
#==, #collection_request, #collection_root, included, #last_page, #next_page, #previous_page
Instance Method Details
#all(options = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/imgur/models/images.rb', line 13 def all(={}) path = "" path = path + "/#{[:resource] || "gallery"}" if [:section] path = path + "/#{[:section]}" elsif [:subreddit] path = path + "/r/#{[:subreddit]}" end path = path + "/#{[:sort]}" if [:sort] path = path + "/#{[:page] || 0}.json" data = connection.get_images(path: path).body["data"] connection.images.load(data) end |