Class: Flickr::Comments
Instance Attribute Summary
Attributes inherited from APIBase
#flickr
Instance Method Summary
collapse
Methods inherited from APIBase
#initialize
Instance Method Details
#add(photo, comment) ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/flickr/comments.rb', line 5
def add(photo, )
photo = photo.id if photo.class == Flickr::Photo
res = @flickr.call_method('flickr.photos.comments.addComment',
'photo_id' => photo, 'comment_text' => )
xml = res.root
xml.attributes['id']
end
|
#delete(comment_id) ⇒ Object
13
14
15
16
|
# File 'lib/flickr/comments.rb', line 13
def delete()
@flickr.call_method('flickr.photos.comments.deleteComment',
'comment_id' => )
end
|
#edit(comment_id, comment) ⇒ Object
18
19
20
21
|
# File 'lib/flickr/comments.rb', line 18
def edit(, )
@flickr.call_method('flickr.photos.comments.editComment',
'comment_id' => , 'comment_text' => )
end
|
#list(photo) ⇒ Object
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/flickr/comments.rb', line 23
def list(photo)
photo = photo.id if photo.class == Flickr::Photo
res = @flickr.call_method('flickr.photos.comments.getList',
'photo_id' => photo)
rv = []
res.elements['//comments'].each_element do |e|
rv << Flickr::Comment.from_xml(e, @flickr)
end
rv
end
|