Class: Flickr::Blogs
Instance Attribute Summary
Attributes inherited from APIBase
Instance Method Summary collapse
- #getList ⇒ Object
-
#postPhoto(blog, photo, title, description, blog_password = nil) ⇒ Object
blog can be either an integer blog ID or a Blog object photo can be either an integer photo ID or a Photo object.
Methods inherited from APIBase
Constructor Details
This class inherits a constructor from Flickr::APIBase
Instance Method Details
#getList ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/flickr/blogs.rb', line 25 def getList() return @flickr.blog_cache_lookup if @flickr.blog_cache_lookup res = @flickr.call_method('flickr.blogs.getList') list = [] res.elements['/blogs'].each_element do |e| att = e.attributes list << Flickr::Blog.new(att['id'], att['name'], att['needspassword'].to_i == 1, att['url']) end @flickr.blog_cache_store(list) return list end |
#postPhoto(blog, photo, title, description, blog_password = nil) ⇒ Object
blog can be either an integer blog ID or a Blog object photo can be either an integer photo ID or a Photo object
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/flickr/blogs.rb', line 40 def postPhoto(blog, photo, title, description, blog_password=nil) blog = blog.id if blog.class == Flickr::Blog photo = photo.id if photo.class == Flickr::Photo args={'blog'=>blog,'photo'=>photo,'title'=>title, description=>'description'} args['blogs_password'] = blog_password if blog_password @flickr.call_method('flickr.blogs.postPhoto',args) end |