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
Returns a new instance of Comment.
128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/imgur.rb', line 128 def initialize(data) @id = data['id'] @image_id = data['image_id'] @caption = data['caption'] @author = data['author'] @author_id = 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.
125 126 127 |
# File 'lib/imgur.rb', line 125 def @author end |
#author_id ⇒ Object
Returns the value of attribute author_id.
125 126 127 |
# File 'lib/imgur.rb', line 125 def @author_id end |
#caption ⇒ Object
Returns the value of attribute caption.
125 126 127 |
# File 'lib/imgur.rb', line 125 def @caption end |
#children ⇒ Object
Returns the value of attribute children.
125 126 127 |
# File 'lib/imgur.rb', line 125 def children @children end |
#date ⇒ Object
Returns the value of attribute date.
125 126 127 |
# File 'lib/imgur.rb', line 125 def date @date end |
#deleted ⇒ Object
Returns the value of attribute deleted.
125 126 127 |
# File 'lib/imgur.rb', line 125 def deleted @deleted end |
#downs ⇒ Object
Returns the value of attribute downs.
125 126 127 |
# File 'lib/imgur.rb', line 125 def downs @downs end |
#id ⇒ Object
Returns the value of attribute id.
125 126 127 |
# File 'lib/imgur.rb', line 125 def id @id end |
#image_id ⇒ Object
Returns the value of attribute image_id.
125 126 127 |
# File 'lib/imgur.rb', line 125 def image_id @image_id end |
#on_album ⇒ Object
Returns the value of attribute on_album.
125 126 127 |
# File 'lib/imgur.rb', line 125 def on_album @on_album end |
#parent_id ⇒ Object
Returns the value of attribute parent_id.
125 126 127 |
# File 'lib/imgur.rb', line 125 def parent_id @parent_id end |
#points ⇒ Object
Returns the value of attribute points.
125 126 127 |
# File 'lib/imgur.rb', line 125 def points @points end |
#ups ⇒ Object
Returns the value of attribute ups.
125 126 127 |
# File 'lib/imgur.rb', line 125 def ups @ups end |
Instance Method Details
#deleted? ⇒ Boolean
159 160 161 |
# File 'lib/imgur.rb', line 159 def deleted? @deleted end |
#downvotes ⇒ Object
151 152 153 |
# File 'lib/imgur.rb', line 151 def downvotes @downs end |
#has_parent? ⇒ Boolean
155 156 157 |
# File 'lib/imgur.rb', line 155 def has_parent? @parent_id != nil end |
#on_album? ⇒ Boolean
143 144 145 |
# File 'lib/imgur.rb', line 143 def on_album? @on_album end |
#upvotes ⇒ Object
147 148 149 |
# File 'lib/imgur.rb', line 147 def upvotes @ups end |