flickr_mock.rb
上传用户:netsea168
上传日期:2022-07-22
资源大小:4652k
文件大小:1k
源码类别:

Ajax

开发平台:

Others

  1. #remove_const "Flickr"
  2. class Flickr
  3.   def initialize(key)
  4.   end
  5.   class Photo
  6.     def initialize(photoid)
  7.       unless photoid == '31366117'
  8.         raise 'Photo not found'
  9.       end
  10.     end
  11.     def sizes
  12.       [{"url"=>"http://www.flickr.com/photo_zoom.gne?id=31366117&size=sq", "height"=>"75", "source"=>"http://photos23.flickr.com/31366117_b1a791d68e_s.jpg", "label"=>"Square", "width"=>"75"}, {"url"=>"http://www.flickr.com/photo_zoom.gne?id=31366117&size=t", "height"=>"100", "source"=>"http://photos23.flickr.com/31366117_b1a791d68e_t.jpg", "label"=>"Thumbnail", "width"=>"67"}, {"url"=>"http://www.flickr.com/photo_zoom.gne?id=31366117&size=s", "height"=>"240", "source"=>"http://photos23.flickr.com/31366117_b1a791d68e_m.jpg", "label"=>"Small", "width"=>"160"}, {"url"=>"http://www.flickr.com/photo_zoom.gne?id=31366117&size=m", "height"=>"500", "source"=>"http://photos23.flickr.com/31366117_b1a791d68e.jpg", "label"=>"Medium", "width"=>"333"}, {"url"=>"http://www.flickr.com/photo_zoom.gne?id=31366117&size=l", "height"=>"1024", "source"=>"http://photos23.flickr.com/31366117_b1a791d68e_b.jpg", "label"=>"Large", "width"=>"683"}, {"url"=>"http://www.flickr.com/photo_zoom.gne?id=31366117&size=o", "height"=>"1536", "source"=>"http://photos23.flickr.com/31366117_b1a791d68e_o.jpg", "label"=>"Original", "width"=>"1024"}]
  13.     end
  14.     def description
  15.       "This is Matz, Ruby's creator"
  16.     end
  17.     def title
  18.       "Matz"
  19.     end
  20.     def url
  21.       "http://www.flickr.com/users/scottlaird/31366117"
  22.     end
  23.   end
  24. end