Class: Camdram::Image

Inherits:
Base
  • Object
show all
Includes:
API
Defined in:
lib/camdram/image.rb

Instance Attribute Summary collapse

Attributes included from API

#http

Attributes inherited from Base

#id

Instance Method Summary collapse

Methods included from API

#initialize, #update!

Methods inherited from Base

#initialize

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



7
8
9
# File 'lib/camdram/image.rb', line 7

def created_at
  @created_at
end

#extensionObject

Returns the value of attribute extension.



7
8
9
# File 'lib/camdram/image.rb', line 7

def extension
  @extension
end

#filenameObject

Returns the value of attribute filename.



7
8
9
# File 'lib/camdram/image.rb', line 7

def filename
  @filename
end

#heightObject

Returns the value of attribute height.



7
8
9
# File 'lib/camdram/image.rb', line 7

def height
  @height
end

#typeObject

Returns the value of attribute type.



7
8
9
# File 'lib/camdram/image.rb', line 7

def type
  @type
end

#widthObject

Returns the value of attribute width.



7
8
9
# File 'lib/camdram/image.rb', line 7

def width
  @width
end

Instance Method Details

#infoHash

Return a hash of the image's attributes

Returns:

  • (Hash)

    Hash with symbolized keys.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/camdram/image.rb', line 12

def info
  {
    id: id,
    filename: filename,
    created_at: created_at,
    width: width,
    height: height,
    extension: extension,
    type: type,
  }
end

#urlString

Return the image URL

Returns:

  • (String)

    The image URL.



27
28
29
# File 'lib/camdram/image.rb', line 27

def url
  "/media/cache/preview/#{filename}"
end