Class: Imgur::Image
- Inherits:
-
Object
- Object
- Imgur::Image
- Defined in:
- lib/imgur.rb
Overview
Represents an image on Imgur
Instance Attribute Summary collapse
-
#animated ⇒ Object
Returns the value of attribute animated.
-
#bandwidth ⇒ Object
Returns the value of attribute bandwidth.
-
#date ⇒ Object
Time object of :datetime.
-
#deletehash ⇒ Object
Returns the value of attribute deletehash.
-
#description ⇒ Object
Returns the value of attribute description.
-
#favorite ⇒ Object
Returns the value of attribute favorite.
-
#height ⇒ Object
Returns the value of attribute height.
-
#html_link ⇒ Object
Returns the value of attribute html_link.
-
#id ⇒ Object
Returns the value of attribute id.
-
#link ⇒ Object
Returns the value of attribute link.
-
#nsfw ⇒ Object
Returns the value of attribute nsfw.
-
#section ⇒ Object
Returns the value of attribute section.
-
#size ⇒ Object
Returns the value of attribute size.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
-
#views ⇒ Object
Returns the value of attribute views.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(data) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(data) ⇒ Image
Returns a new instance of Image.
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/imgur.rb', line 164 def initialize(data) @id = data['id'] @title = data['title'] @description = data['description'] @date = Time.at data['datetime'] @type = data['type'] @animated = data['animated'] @width = data['width'] @height = data['height'] @size = data['size'] @views = data['views'] @bandwidth = data['bandwidth'] @favorite = data['favorite'] @nsfw = data['nsfw'] @section = data['section'] @deletehash = data['deletehash'] @link = data['link'] @html_link = HTML_PATH + @id end |
Instance Attribute Details
#animated ⇒ Object
Returns the value of attribute animated.
151 152 153 |
# File 'lib/imgur.rb', line 151 def animated @animated end |
#bandwidth ⇒ Object
Returns the value of attribute bandwidth.
156 157 158 |
# File 'lib/imgur.rb', line 156 def bandwidth @bandwidth end |
#date ⇒ Object
Time object of :datetime
149 150 151 |
# File 'lib/imgur.rb', line 149 def date @date end |
#deletehash ⇒ Object
Returns the value of attribute deletehash.
160 161 162 |
# File 'lib/imgur.rb', line 160 def deletehash @deletehash end |
#description ⇒ Object
Returns the value of attribute description.
148 149 150 |
# File 'lib/imgur.rb', line 148 def description @description end |
#favorite ⇒ Object
Returns the value of attribute favorite.
157 158 159 |
# File 'lib/imgur.rb', line 157 def favorite @favorite end |
#height ⇒ Object
Returns the value of attribute height.
153 154 155 |
# File 'lib/imgur.rb', line 153 def height @height end |
#html_link ⇒ Object
Returns the value of attribute html_link.
162 163 164 |
# File 'lib/imgur.rb', line 162 def html_link @html_link end |
#id ⇒ Object
Returns the value of attribute id.
146 147 148 |
# File 'lib/imgur.rb', line 146 def id @id end |
#link ⇒ Object
Returns the value of attribute link.
161 162 163 |
# File 'lib/imgur.rb', line 161 def link @link end |
#nsfw ⇒ Object
Returns the value of attribute nsfw.
158 159 160 |
# File 'lib/imgur.rb', line 158 def nsfw @nsfw end |
#section ⇒ Object
Returns the value of attribute section.
159 160 161 |
# File 'lib/imgur.rb', line 159 def section @section end |
#size ⇒ Object
Returns the value of attribute size.
154 155 156 |
# File 'lib/imgur.rb', line 154 def size @size end |
#title ⇒ Object
Returns the value of attribute title.
147 148 149 |
# File 'lib/imgur.rb', line 147 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
150 151 152 |
# File 'lib/imgur.rb', line 150 def type @type end |
#views ⇒ Object
Returns the value of attribute views.
155 156 157 |
# File 'lib/imgur.rb', line 155 def views @views end |
#width ⇒ Object
Returns the value of attribute width.
152 153 154 |
# File 'lib/imgur.rb', line 152 def width @width end |