Class: Kippt::Comments
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#create, #destroy_resource, #save_resource
#[]
Constructor Details
#initialize(client, clip) ⇒ Comments
Returns a new instance of Comments.
9
10
11
12
|
# File 'lib/kippt/comments.rb', line 9
def initialize(client, clip)
@client = client
@clip = clip
end
|
Instance Attribute Details
#clip ⇒ Object
Returns the value of attribute clip.
7
8
9
|
# File 'lib/kippt/comments.rb', line 7
def clip
@clip
end
|
Class Method Details
.valid_filter_parameters ⇒ Object
14
15
16
|
# File 'lib/kippt/comments.rb', line 14
def self.valid_filter_parameters
[:limit, :offset]
end
|
Instance Method Details
#base_uri ⇒ Object
26
27
28
|
# File 'lib/kippt/comments.rb', line 26
def base_uri
"clips/#{clip.id}/comments"
end
|
#build(attributes = {}) ⇒ Object
42
43
44
|
# File 'lib/kippt/comments.rb', line 42
def build(attributes = {})
object_class.new(attributes, client, clip)
end
|
#collection_class ⇒ Object
#fetch(options = {}) ⇒ Object
Also known as:
all
30
31
32
33
34
35
36
37
38
|
# File 'lib/kippt/comments.rb', line 30
def fetch(options = {})
validate_collection_options(options)
if options.empty? && @clip.
collection_class.new({"objects" => @clip.}, client)
else
collection_class.new(client.get(base_uri, options).body, client)
end
end
|
#object_class ⇒ Object
18
19
20
|
# File 'lib/kippt/comments.rb', line 18
def object_class
Kippt::Comment
end
|