Class: Spina::Image
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Spina::Image
- Includes:
- Attachable
- Defined in:
- app/models/spina/image.rb
Instance Method Summary collapse
Methods included from Attachable
Methods inherited from ApplicationRecord
Instance Method Details
#content ⇒ Object
17 18 19 |
# File 'app/models/spina/image.rb', line 17 def content self end |
#thumbnail(size = "100x100", modifier = "^") ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'app/models/spina/image.rb', line 21 def thumbnail(size = "100x100", modifier = "^") variant( combine_options: { gravity: "center", thumbnail: "#{size}#{modifier}", extent: size } ) end |
#variant(options) ⇒ Object
9 10 11 12 13 14 15 |
# File 'app/models/spina/image.rb', line 9 def variant() return "" unless file.attached? return file if file.content_type.include?("svg") return file unless file.variable? file.variant() end |