Class: Piwigo::Images::Image
- Inherits:
-
Object
- Object
- Piwigo::Images::Image
- Defined in:
- lib/piwigo/images.rb
Instance Attribute Summary collapse
-
#categories ⇒ <Type>
List of all of the Albums this image is in.
-
#comment ⇒ String
Comments about the image.
-
#date_available ⇒ DateTime
DateTime when the image was uploaded to Piwigo.
-
#date_creation ⇒ DateTime
DateTime when the image was taken.
-
#derivatives ⇒ Array<String>
Links to different sizes of the image.
-
#element_url ⇒ String
URL to the image itself.
-
#file ⇒ String
Filename for the image.
-
#height ⇒ Number
Height of the image in pixels.
-
#hit ⇒ Number
Number of times the image has been viewed.
-
#id ⇒ Number
Unique ID identifying this ie.
-
#name ⇒ String
Name of the image.
-
#page_url ⇒ String
URL to the image page.
-
#width ⇒ Number
Width of the image in pixels.
Instance Method Summary collapse
-
#initialize(hash: nil) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(hash: nil) ⇒ Image
Returns a new instance of Image.
53 54 55 56 57 58 59 |
# File 'lib/piwigo/images.rb', line 53 def initialize(hash: nil) hash&.each do |key, value| # Bug: If the encoding is Windows-1252, then Piwigo will blowup when creating the album value = value.encode('UTF-8', 'Windows-1252') if value.instance_of?(String) && value.encoding.to_s == 'Windows-1252' send("#{key}=", value) end end |
Instance Attribute Details
#categories ⇒ <Type>
Returns List of all of the Albums this image is in.
51 52 53 |
# File 'lib/piwigo/images.rb', line 51 def categories @categories end |
#comment ⇒ String
Returns Comments about the image.
33 34 35 |
# File 'lib/piwigo/images.rb', line 33 def comment @comment end |
#date_available ⇒ DateTime
Returns DateTime when the image was uploaded to Piwigo.
39 40 41 |
# File 'lib/piwigo/images.rb', line 39 def date_available @date_available end |
#date_creation ⇒ DateTime
Returns DateTime when the image was taken.
36 37 38 |
# File 'lib/piwigo/images.rb', line 36 def date_creation @date_creation end |
#derivatives ⇒ Array<String>
Returns Links to different sizes of the image.
48 49 50 |
# File 'lib/piwigo/images.rb', line 48 def derivatives @derivatives end |
#element_url ⇒ String
Returns URL to the image itself.
45 46 47 |
# File 'lib/piwigo/images.rb', line 45 def element_url @element_url end |
#file ⇒ String
Returns Filename for the image.
27 28 29 |
# File 'lib/piwigo/images.rb', line 27 def file @file end |
#height ⇒ Number
Returns Height of the image in pixels.
21 22 23 |
# File 'lib/piwigo/images.rb', line 21 def height @height end |
#hit ⇒ Number
Returns Number of times the image has been viewed.
24 25 26 |
# File 'lib/piwigo/images.rb', line 24 def hit @hit end |
#id ⇒ Number
Returns Unique ID identifying this ie.
15 16 17 |
# File 'lib/piwigo/images.rb', line 15 def id @id end |
#name ⇒ String
Returns Name of the image.
30 31 32 |
# File 'lib/piwigo/images.rb', line 30 def name @name end |
#page_url ⇒ String
Returns URL to the image page.
42 43 44 |
# File 'lib/piwigo/images.rb', line 42 def page_url @page_url end |
#width ⇒ Number
Returns Width of the image in pixels.
18 19 20 |
# File 'lib/piwigo/images.rb', line 18 def width @width end |