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.
53 54 55 |
# File 'app/models/pageflow/theme_customization_file.rb', line 53 def .except(:original) end |
#file_name ⇒ Object
The name of the originally uploaded file
35 36 37 |
# File 'app/models/pageflow/theme_customization_file.rb', line 35 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.
48 49 50 |
# File 'app/models/pageflow/theme_customization_file.rb', line 48 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.
58 59 60 61 |
# File 'app/models/pageflow/theme_customization_file.rb', line 58 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.
41 42 43 44 45 |
# File 'app/models/pageflow/theme_customization_file.rb', line 41 def urls .map { |style, _| [style, .url(style)] }.to_h end |