Class: Pageflow::ThemeCustomizationFile
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Pageflow::ThemeCustomizationFile
- Defined in:
- app/models/pageflow/theme_customization_file.rb
Overview
A file that has been uploaded by the user to customize a theme, e.g., to use a custom logo.
Defined Under Namespace
Classes: AttachmentContentTypeValidator
Instance Method Summary collapse
- #attachment_styles ⇒ Object private
-
#file_name ⇒ Object
The name of the originally uploaded file.
- #options_from_entry_type ⇒ Object private
- #styles_from_options ⇒ Object private
-
#urls ⇒ Object
A hash of urls based on the styles that were defined when registering the entry type.
Instance Method Details
#attachment_styles ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
54 55 56 |
# File 'app/models/pageflow/theme_customization_file.rb', line 54 def .except(:original) end |
#file_name ⇒ Object
The name of the originally uploaded file
36 37 38 |
# File 'app/models/pageflow/theme_customization_file.rb', line 36 def file_name end |
#options_from_entry_type ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
49 50 51 |
# File 'app/models/pageflow/theme_customization_file.rb', line 49 def theme_customization.entry_type.theme_files.fetch(type_name.to_sym, {}) end |
#styles_from_options ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
59 60 61 62 |
# File 'app/models/pageflow/theme_customization_file.rb', line 59 def styles = .fetch(:styles, {}) styles.respond_to?(:call) ? styles.call(self) : styles end |
#urls ⇒ Object
A hash of urls based on the styles that were defined when registering the entry type.
42 43 44 45 46 |
# File 'app/models/pageflow/theme_customization_file.rb', line 42 def urls .to_h do |style, _| [style, .url(style)] end end |