Sha256: d98192165f49a8bdd8dd5f38ea7aeed09d3888b6015690a73535674425a89e03
Contents?: true
Size: 701 Bytes
Versions: 41
Compression:
Stored size: 701 Bytes
Contents
require "rubygems" require "bundler/setup" require "./examples/config" if File.exists?('examples/config.rb') require "api_client" module Flickr class Base < ApiClient::Base always do endpoint "http://api.flickr.com" params :api_key => FLICKR_API_KEY, :format => 'json', :nojsoncallback => 1 end end class Collection < Base def self.interesting build params(:method => 'flickr.interestingness.getList'). get("/services/rest") end def photos Photo.build self['photos']['photo'] end end class Photo < Base end end Flickr::Collection.interesting.photos.each do |photo| puts photo.title end
Version data entries
41 entries across 41 versions & 1 rubygems