Class: Ckeditor::Picture
- Inherits:
-
Asset
- Object
- ActiveRecord::Base
- Asset
- Ckeditor::Picture
show all
- Defined in:
- lib/generators/ckeditor/templates/mongoid/shrine/ckeditor/picture.rb,
lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/picture.rb,
lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/picture.rb,
lib/generators/ckeditor/templates/active_record/shrine/ckeditor/picture.rb,
lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/picture.rb,
lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/picture.rb,
lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/picture.rb,
lib/generators/ckeditor/templates/active_record/active_storage/ckeditor/picture.rb
Constant Summary
Backend::Dragonfly::FORMATS
Instance Attribute Summary
Attributes inherited from Asset
#data
Instance Method Summary
collapse
included
included
included
included
included
included
Instance Method Details
#datasource ⇒ Object
44
45
46
47
48
49
|
# File 'lib/generators/ckeditor/templates/mongoid/shrine/ckeditor/picture.rb', line 44
def datasource
@datasource ||= HashWithIndifferentAccess
.new(data)
.fetch(:thumb, OpenStruct.new(metadata: {}))
.metadata
end
|
#path ⇒ Object
40
41
42
|
# File 'lib/generators/ckeditor/templates/mongoid/shrine/ckeditor/picture.rb', line 40
def path
data[:thumb].storage.path(data[:thumb].id)
end
|
#url_content ⇒ Object
6
7
8
|
# File 'lib/generators/ckeditor/templates/active_record/active_storage/ckeditor/picture.rb', line 6
def url_content
data_url(:content)
end
|
#url_thumb ⇒ Object
36
37
38
|
# File 'lib/generators/ckeditor/templates/mongoid/shrine/ckeditor/picture.rb', line 36
def url_thumb
data_url(:thumb)
end
|