Class: Piwigo::Images::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/piwigo/images.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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.

Returns:

  • (<Type>)

    List of all of the Albums this image is in



51
52
53
# File 'lib/piwigo/images.rb', line 51

def categories
  @categories
end

#commentString

Returns Comments about the image.

Returns:

  • (String)

    Comments about the image



33
34
35
# File 'lib/piwigo/images.rb', line 33

def comment
  @comment
end

#date_availableDateTime

Returns DateTime when the image was uploaded to Piwigo.

Returns:

  • (DateTime)

    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_creationDateTime

Returns DateTime when the image was taken.

Returns:

  • (DateTime)

    DateTime when the image was taken



36
37
38
# File 'lib/piwigo/images.rb', line 36

def date_creation
  @date_creation
end

#derivativesArray<String>

Returns Links to different sizes of the image.

Returns:

  • (Array<String>)

    Links to different sizes of the image



48
49
50
# File 'lib/piwigo/images.rb', line 48

def derivatives
  @derivatives
end

#element_urlString

Returns URL to the image itself.

Returns:

  • (String)

    URL to the image itself



45
46
47
# File 'lib/piwigo/images.rb', line 45

def element_url
  @element_url
end

#fileString

Returns Filename for the image.

Returns:

  • (String)

    Filename for the image



27
28
29
# File 'lib/piwigo/images.rb', line 27

def file
  @file
end

#heightNumber

Returns Height of the image in pixels.

Returns:

  • (Number)

    Height of the image in pixels



21
22
23
# File 'lib/piwigo/images.rb', line 21

def height
  @height
end

#hitNumber

Returns Number of times the image has been viewed.

Returns:

  • (Number)

    Number of times the image has been viewed



24
25
26
# File 'lib/piwigo/images.rb', line 24

def hit
  @hit
end

#idNumber

Returns Unique ID identifying this ie.

Returns:

  • (Number)

    Unique ID identifying this ie



15
16
17
# File 'lib/piwigo/images.rb', line 15

def id
  @id
end

#nameString

Returns Name of the image.

Returns:

  • (String)

    Name of the image



30
31
32
# File 'lib/piwigo/images.rb', line 30

def name
  @name
end

#page_urlString

Returns URL to the image page.

Returns:

  • (String)

    URL to the image page



42
43
44
# File 'lib/piwigo/images.rb', line 42

def page_url
  @page_url
end

#widthNumber

Returns Width of the image in pixels.

Returns:

  • (Number)

    Width of the image in pixels



18
19
20
# File 'lib/piwigo/images.rb', line 18

def width
  @width
end