Class: Podio::Comment
Instance Attribute Summary collapse
#attributes, #error_code, #error_message, #error_parameters, #error_propagate
Class Method Summary
collapse
Instance Method Summary
collapse
#==, #[], #[]=, #api_friendly_ref_type, #as_json, collection, delegate_to_hash, handle_api_errors_for, has_many, has_one, #hash, #initialize, list, member, #new_record?, #persisted?, property, #to_param
Instance Attribute Details
Returns the value of attribute commentable_id.
22
23
24
|
# File 'lib/podio/models/comment.rb', line 22
def
@commentable_id
end
|
Returns the value of attribute commentable_type.
22
23
24
|
# File 'lib/podio/models/comment.rb', line 22
def
@commentable_type
end
|
Class Method Details
.create(commentable_type, commentable_id, attributes) ⇒ Object
29
30
31
32
33
34
35
36
|
# File 'lib/podio/models/comment.rb', line 29
def create(, , attributes)
response = Podio.connection.post do |req|
req.url "/comment/#{}/#{}"
req.body = attributes
end
response.body['comment_id']
end
|
.delete(id) ⇒ Object
47
48
49
|
# File 'lib/podio/models/comment.rb', line 47
def delete(id)
Podio.connection.delete("/comment/#{id}").status
end
|
.find(id) ⇒ Object
51
52
53
|
# File 'lib/podio/models/comment.rb', line 51
def find(id)
member Podio.connection.get("/comment/#{id}").body
end
|
.find_all_for(commentable_type, commentable_id) ⇒ Object
55
56
57
|
# File 'lib/podio/models/comment.rb', line 55
def find_all_for(, )
list Podio.connection.get("/comment/#{}/#{}").body
end
|
.find_recent_for_share ⇒ Object
59
60
61
62
|
# File 'lib/podio/models/comment.rb', line 59
def find_recent_for_share
list Podio.connection.get("/comment/share/").body
end
|
.update(id, attributes) ⇒ Object
38
39
40
41
42
43
44
45
|
# File 'lib/podio/models/comment.rb', line 38
def update(id, attributes)
response = Podio.connection.put do |req|
req.url "/comment/#{id}"
req.body = attributes
end
response.status
end
|
Instance Method Details
#create ⇒ Object
24
25
26
|
# File 'lib/podio/models/comment.rb', line 24
def create
self. = Comment.create(, , attributes)
end
|