Class: Podio::Comment
Overview
Instance Attribute Summary collapse
#attributes
Class Method Summary
collapse
Instance Method Summary
collapse
#==, #[], #[]=, #api_friendly_ref_type, #as_json, collection, delegate_to_hash, has_many, has_one, #hash, #initialize, #initialize_attributes, klass_from_string, list, member, #new_record?, output_attribute_as_json, #parent_model, #persisted?, property, #to_param
Instance Attribute Details
Returns the value of attribute commentable_id.
30
31
32
|
# File 'lib/podio/models/comment.rb', line 30
def
@commentable_id
end
|
Returns the value of attribute commentable_type.
30
31
32
|
# File 'lib/podio/models/comment.rb', line 30
def
@commentable_type
end
|
Class Method Details
.create(commentable_type, commentable_id, attributes, options = {}) ⇒ Object
41
42
43
44
45
46
47
48
|
# File 'lib/podio/models/comment.rb', line 41
def create(, , attributes, options={})
response = Podio.connection.post do |req|
req.url("/comment/#{}/#{}", options)
req.body = attributes
end
response.body
end
|
.delete(id) ⇒ Object
61
62
63
|
# File 'lib/podio/models/comment.rb', line 61
def delete(id)
Podio.connection.delete("/comment/#{id}").status
end
|
.find(id) ⇒ Object
66
67
68
|
# File 'lib/podio/models/comment.rb', line 66
def find(id)
member Podio.connection.get("/comment/#{id}").body
end
|
.find_all_for(commentable_type, commentable_id) ⇒ Object
71
72
73
|
# File 'lib/podio/models/comment.rb', line 71
def find_all_for(, )
list Podio.connection.get("/comment/#{}/#{}").body
end
|
.find_recent_for_share ⇒ Object
75
76
77
78
|
# File 'lib/podio/models/comment.rb', line 75
def find_recent_for_share
list Podio.connection.get("/comment/share/").body
end
|
.liked_by(id) ⇒ Object
81
82
83
|
# File 'lib/podio/models/comment.rb', line 81
def liked_by(id)
Podio.connection.get("/comment/#{id}/liked_by/").body.map{|values| Podio::Contact.new(values)}
end
|
.update(id, attributes) ⇒ Object
51
52
53
54
55
56
57
58
|
# File 'lib/podio/models/comment.rb', line 51
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(options = {}) ⇒ Object
33
34
35
36
37
|
# File 'lib/podio/models/comment.rb', line 33
def create(options={})
updated_attributes = Comment.create(self., self., self.attributes, options)
self.attributes = updated_attributes.symbolize_keys
self.initialize_attributes(self.attributes)
end
|