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.
137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/imgur.rb', line 137 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.
125 126 127 |
# File 'lib/imgur.rb', line 125 def end |
#author_id ⇒ Object
Returns the value of attribute author_id.
127 128 129 |
# File 'lib/imgur.rb', line 127 def end |
#caption ⇒ Object
Returns the value of attribute caption.
124 125 126 |
# File 'lib/imgur.rb', line 124 def caption @caption end |
#children ⇒ Object
Returns the value of attribute children.
135 136 137 |
# File 'lib/imgur.rb', line 135 def children @children end |
#date ⇒ Object
Returns the value of attribute date.
132 133 134 |
# File 'lib/imgur.rb', line 132 def date @date end |
#deleted ⇒ Object
Returns the value of attribute deleted.
134 135 136 |
# File 'lib/imgur.rb', line 134 def deleted @deleted end |
#downs ⇒ Object
Returns the value of attribute downs.
130 131 132 |
# File 'lib/imgur.rb', line 130 def downs @downs end |
#id ⇒ Object
Returns the value of attribute id.
122 123 124 |
# File 'lib/imgur.rb', line 122 def id @id end |
#image_id ⇒ Object
Returns the value of attribute image_id.
123 124 125 |
# File 'lib/imgur.rb', line 123 def image_id @image_id end |
#on_album ⇒ Object
Returns the value of attribute on_album.
128 129 130 |
# File 'lib/imgur.rb', line 128 def on_album @on_album end |
#parent_id ⇒ Object
Returns the value of attribute parent_id.
133 134 135 |
# File 'lib/imgur.rb', line 133 def parent_id @parent_id end |
#points ⇒ Object
Returns the value of attribute points.
131 132 133 |
# File 'lib/imgur.rb', line 131 def points @points end |
#ups ⇒ Object
Returns the value of attribute ups.
129 130 131 |
# File 'lib/imgur.rb', line 129 def ups @ups end |
Instance Method Details
#deleted? ⇒ Boolean
168 169 170 |
# File 'lib/imgur.rb', line 168 def deleted? @deleted end |
#downvotes ⇒ Object
160 161 162 |
# File 'lib/imgur.rb', line 160 def downvotes @downs end |
#has_parent? ⇒ Boolean
164 165 166 |
# File 'lib/imgur.rb', line 164 def has_parent? @parent_id != nil end |
#on_album? ⇒ Boolean
152 153 154 |
# File 'lib/imgur.rb', line 152 def on_album? @on_album end |
#upvotes ⇒ Object
156 157 158 |
# File 'lib/imgur.rb', line 156 def upvotes @ups end |