Class: Fiona7::BinaryHandling::MetaBinary::UnmodifiedBinary
Instance Method Summary
collapse
#initialize
Instance Method Details
#filename ⇒ Object
64
65
66
|
# File 'lib/fiona7/scrivito_patches/binary.rb', line 64
def filename
self.obj.filename
end
|
#filepath ⇒ Object
68
69
70
|
# File 'lib/fiona7/scrivito_patches/binary.rb', line 68
def filepath
self.obj.body_data_path
end
|
#height ⇒ Object
92
93
94
95
96
97
98
99
100
101
102
|
# File 'lib/fiona7/scrivito_patches/binary.rb', line 92
def height
self.cache("#{self.last_changed}-height") do
if self.image
self.image[:height]
else
0
end
end
rescue
0
end
|
#image? ⇒ Boolean
76
77
78
|
# File 'lib/fiona7/scrivito_patches/binary.rb', line 76
def image?
self.obj.image?
end
|
#last_changed ⇒ Object
108
109
110
|
# File 'lib/fiona7/scrivito_patches/binary.rb', line 108
def last_changed
self.obj.last_changed.utc
end
|
#length ⇒ Object
72
73
74
|
# File 'lib/fiona7/scrivito_patches/binary.rb', line 72
def length
self.obj.body_length
end
|
#mime_type ⇒ Object
104
105
106
|
# File 'lib/fiona7/scrivito_patches/binary.rb', line 104
def mime_type
self.obj.mime_type
end
|
#present? ⇒ Boolean
60
61
62
|
# File 'lib/fiona7/scrivito_patches/binary.rb', line 60
def present?
!self.obj.nil?
end
|
#valid? ⇒ Boolean
56
57
58
|
# File 'lib/fiona7/scrivito_patches/binary.rb', line 56
def valid?
self.binary_id >= 0 && self.obj.try(:binary?)
end
|
#width ⇒ Object
80
81
82
83
84
85
86
87
88
89
90
|
# File 'lib/fiona7/scrivito_patches/binary.rb', line 80
def width
self.cache("#{self.last_changed}-width") do
if self.image
self.image[:width]
else
0
end
end
rescue
0
end
|