Class: Attachs::Types::Regular
- Inherits:
-
Base
- Object
- Base
- Attachs::Types::Regular
show all
- Defined in:
- lib/attachs/types/regular.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#basename ⇒ Object
7
8
9
|
# File 'lib/attachs/types/regular.rb', line 7
def basename
@basename ||= File.basename(attachment.filename, ".#{extension}")
end
|
#extension ⇒ Object
11
12
13
|
# File 'lib/attachs/types/regular.rb', line 11
def extension
@extension ||= File.extname(attachment.filename).from(1)
end
|
#image? ⇒ Boolean
15
16
17
|
# File 'lib/attachs/types/regular.rb', line 15
def image?
@image ||= attachment.content_type.start_with?('image')
end
|