Class: Pastvu::CommentCollection

Inherits:
Collection show all
Defined in:
lib/pastvu/comment/comment_collection.rb

Instance Attribute Summary

Attributes inherited from BasicResponse

#hash, #json

Instance Method Summary collapse

Methods inherited from Collection

#each

Methods inherited from BasicResponse

#to_hash, #to_json

Constructor Details

#initialize(attributes) ⇒ CommentCollection

Returns a new instance of CommentCollection.



3
4
5
6
7
# File 'lib/pastvu/comment/comment_collection.rb', line 3

def initialize(attributes)
  super attributes
  @path = %w[result comments]
  @model = Comment
end

Instance Method Details

#photoObject



14
15
16
# File 'lib/pastvu/comment/comment_collection.rb', line 14

def photo
  Pastvu.photo @hash["result"]["cid"]
end

#usersObject



9
10
11
12
# File 'lib/pastvu/comment/comment_collection.rb', line 9

def users
  @hash ||= self.to_hash
  @hash["result"]["users"]
end