Class: CKEditor5::Rails::Assets::AssetsBundleHtmlSerializer
- Inherits:
-
Object
- Object
- CKEditor5::Rails::Assets::AssetsBundleHtmlSerializer
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- lib/ckeditor5/rails/assets/assets_bundle_html_serializer.rb
Instance Attribute Summary collapse
-
#bundle ⇒ Object
readonly
Returns the value of attribute bundle.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(bundle) ⇒ AssetsBundleHtmlSerializer
constructor
A new instance of AssetsBundleHtmlSerializer.
- #to_html ⇒ Object
Constructor Details
#initialize(bundle) ⇒ AssetsBundleHtmlSerializer
Returns a new instance of AssetsBundleHtmlSerializer.
14 15 16 17 18 |
# File 'lib/ckeditor5/rails/assets/assets_bundle_html_serializer.rb', line 14 def initialize(bundle) raise TypeError, 'bundle must be an instance of AssetsBundle' unless bundle.is_a?(AssetsBundle) @bundle = bundle end |
Instance Attribute Details
#bundle ⇒ Object (readonly)
Returns the value of attribute bundle.
12 13 14 |
# File 'lib/ckeditor5/rails/assets/assets_bundle_html_serializer.rb', line 12 def bundle @bundle end |
Class Method Details
.url_resource_preload_type(url) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/ckeditor5/rails/assets/assets_bundle_html_serializer.rb', line 30 def self.url_resource_preload_type(url) case File.extname(url) when '.js' then 'script' when '.css' then 'style' else 'fetch' end end |
Instance Method Details
#to_html ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/ckeditor5/rails/assets/assets_bundle_html_serializer.rb', line 20 def to_html safe_join([ , , , scripts_import_map_tag, web_component_tag ]) end |