Class: Hotchoc::File
- Inherits:
-
Base
- Object
- Base
- Hotchoc::File
show all
- Defined in:
- lib/hotchoc/file.rb
Instance Attribute Summary
Attributes inherited from Base
#item
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Constructor Details
This class inherits a constructor from Hotchoc::Base
Instance Method Details
#content_type ⇒ Object
27
28
29
|
# File 'lib/hotchoc/file.rb', line 27
def content_type
@item['content_type']
end
|
#created_at ⇒ Object
44
45
46
|
# File 'lib/hotchoc/file.rb', line 44
def created_at
Time.parse(@item['created_at'])
end
|
#exif ⇒ Object
40
41
42
|
# File 'lib/hotchoc/file.rb', line 40
def exif
@item['exif']
end
|
#height ⇒ Object
19
20
21
|
# File 'lib/hotchoc/file.rb', line 19
def height
@item['height']
end
|
#id ⇒ Object
3
4
5
|
# File 'lib/hotchoc/file.rb', line 3
def id
@item['id']
end
|
#inspect ⇒ Object
52
53
54
|
# File 'lib/hotchoc/file.rb', line 52
def inspect
%(#<Hotchoc::File: name="#{name}">)
end
|
#name ⇒ Object
7
8
9
|
# File 'lib/hotchoc/file.rb', line 7
def name
@item['name']
end
|
#size ⇒ Object
23
24
25
|
# File 'lib/hotchoc/file.rb', line 23
def size
@item['size']
end
|
#thumbnails ⇒ Object
31
32
33
34
35
36
37
38
|
# File 'lib/hotchoc/file.rb', line 31
def thumbnails
if @item['thumbnails']
@item['thumbnails']['original'].map { |thumbnail| Hotchoc::Thumbnail.new(thumbnail) } +
@item['thumbnails']['square'].map { |thumbnail| Hotchoc::Thumbnail.new(thumbnail) }
else
[]
end
end
|
#updated_at ⇒ Object
48
49
50
|
# File 'lib/hotchoc/file.rb', line 48
def updated_at
Time.parse(@item['updated_at'])
end
|
#url ⇒ Object
11
12
13
|
# File 'lib/hotchoc/file.rb', line 11
def url
@item['url']
end
|
#width ⇒ Object
15
16
17
|
# File 'lib/hotchoc/file.rb', line 15
def width
@item['width']
end
|