Class: Imgur::Comment
- Inherits:
-
Object
- Object
- Imgur::Comment
- Defined in:
- lib/imgur.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#author_id ⇒ Object
Returns the value of attribute author_id.
-
#caption ⇒ Object
Returns the value of attribute caption.
-
#children ⇒ Object
Returns the value of attribute children.
-
#date ⇒ Object
Returns the value of attribute date.
-
#deleted ⇒ Object
Returns the value of attribute deleted.
-
#downs ⇒ Object
Returns the value of attribute downs.
-
#id ⇒ Object
Returns the value of attribute id.
-
#image_id ⇒ Object
Returns the value of attribute image_id.
-
#on_album ⇒ Object
Returns the value of attribute on_album.
-
#parent_id ⇒ Object
Returns the value of attribute parent_id.
-
#points ⇒ Object
Returns the value of attribute points.
-
#ups ⇒ Object
Returns the value of attribute ups.
Instance Method Summary collapse
- #deleted? ⇒ Boolean
- #downvotes ⇒ Object
- #has_parent? ⇒ Boolean
-
#initialize(data) ⇒ Comment
constructor
A new instance of Comment.
- #on_album? ⇒ Boolean
- #upvotes ⇒ Object
Constructor Details
#initialize(data) ⇒ Comment
142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/imgur.rb', line 142 def initialize(data) @id = data['id'] @image_id = data['image_id'] @caption = data['caption'] = data['author'] = data['author_id'] @on_album = data['on_album'] @ups = data['ups'] @downs = data['downs'] @points = data['points'] @date = Time.at data['datetime'] @parent_id = data['parent_id'] @deleted = deleted end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
130 131 132 |
# File 'lib/imgur.rb', line 130 def end |
#author_id ⇒ Object
Returns the value of attribute author_id.
132 133 134 |
# File 'lib/imgur.rb', line 132 def end |
#caption ⇒ Object
Returns the value of attribute caption.
129 130 131 |
# File 'lib/imgur.rb', line 129 def caption @caption end |
#children ⇒ Object
Returns the value of attribute children.
140 141 142 |
# File 'lib/imgur.rb', line 140 def children @children end |
#date ⇒ Object
Returns the value of attribute date.
137 138 139 |
# File 'lib/imgur.rb', line 137 def date @date end |
#deleted ⇒ Object
Returns the value of attribute deleted.
139 140 141 |
# File 'lib/imgur.rb', line 139 def deleted @deleted end |
#downs ⇒ Object
Returns the value of attribute downs.
135 136 137 |
# File 'lib/imgur.rb', line 135 def downs @downs end |
#id ⇒ Object
Returns the value of attribute id.
127 128 129 |
# File 'lib/imgur.rb', line 127 def id @id end |
#image_id ⇒ Object
Returns the value of attribute image_id.
128 129 130 |
# File 'lib/imgur.rb', line 128 def image_id @image_id end |
#on_album ⇒ Object
Returns the value of attribute on_album.
133 134 135 |
# File 'lib/imgur.rb', line 133 def on_album @on_album end |
#parent_id ⇒ Object
Returns the value of attribute parent_id.
138 139 140 |
# File 'lib/imgur.rb', line 138 def parent_id @parent_id end |
#points ⇒ Object
Returns the value of attribute points.
136 137 138 |
# File 'lib/imgur.rb', line 136 def points @points end |
#ups ⇒ Object
Returns the value of attribute ups.
134 135 136 |
# File 'lib/imgur.rb', line 134 def ups @ups end |
Instance Method Details
#deleted? ⇒ Boolean
173 174 175 |
# File 'lib/imgur.rb', line 173 def deleted? @deleted end |
#downvotes ⇒ Object
165 166 167 |
# File 'lib/imgur.rb', line 165 def downvotes @downs end |
#has_parent? ⇒ Boolean
169 170 171 |
# File 'lib/imgur.rb', line 169 def has_parent? @parent_id != nil end |
#on_album? ⇒ Boolean
157 158 159 |
# File 'lib/imgur.rb', line 157 def on_album? @on_album end |
#upvotes ⇒ Object
161 162 163 |
# File 'lib/imgur.rb', line 161 def upvotes @ups end |