Class: FbookGraph::Image
- Inherits:
-
Object
- Object
- FbookGraph::Image
- Defined in:
- lib/fbook_graph/image.rb
Class Method Summary collapse
Class Method Details
.all(albums: [], options: {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/fbook_graph/image.rb', line 5 def all(albums: [], options: {}) request = Request.new() data = request.parsed_response['photos']['data'] images = [] if albums.empty? images = data else albums.each do |album| data.each do |image| if image['album'] images << image if image['album']['name'].include? album.capitalize end end end end images.map { |image| image['images'][0]['source'] } end |