Class: CKEditor5::Rails::Cdn::CKEditorBundle
- Inherits:
-
Assets::AssetsBundle
- Object
- Assets::AssetsBundle
- CKEditor5::Rails::Cdn::CKEditorBundle
- Includes:
- UrlGenerator
- Defined in:
- lib/ckeditor5/rails/cdn/ckeditor_bundle.rb
Constant Summary
Constants included from UrlGenerator
UrlGenerator::CDN_COMMERCIAL_GENERATORS, UrlGenerator::CDN_THIRD_PARTY_GENERATORS
Instance Attribute Summary collapse
-
#import_name ⇒ Object
readonly
Returns the value of attribute import_name.
-
#translations ⇒ Object
readonly
Returns the value of attribute translations.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(version, import_name, cdn: Engine.default_preset.cdn, translations: []) ⇒ CKEditorBundle
constructor
A new instance of CKEditorBundle.
- #scripts ⇒ Object
- #stylesheets ⇒ Object
Methods included from UrlGenerator
Methods inherited from Assets::AssetsBundle
#<<, #empty?, #preloads, #translations_scripts
Constructor Details
#initialize(version, import_name, cdn: Engine.default_preset.cdn, translations: []) ⇒ CKEditorBundle
Returns a new instance of CKEditorBundle.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ckeditor5/rails/cdn/ckeditor_bundle.rb', line 10 def initialize(version, import_name, cdn: Engine.default_preset.cdn, translations: []) raise ArgumentError, 'version must be semver' unless version.is_a?(Semver) raise ArgumentError, 'import_name must be a string' unless import_name.is_a?(String) raise ArgumentError, 'translations must be an array' unless translations.is_a?(Array) super() @cdn = cdn @version = version @import_name = import_name @translations = translations end |
Instance Attribute Details
#import_name ⇒ Object (readonly)
Returns the value of attribute import_name.
8 9 10 |
# File 'lib/ckeditor5/rails/cdn/ckeditor_bundle.rb', line 8 def import_name @import_name end |
#translations ⇒ Object (readonly)
Returns the value of attribute translations.
8 9 10 |
# File 'lib/ckeditor5/rails/cdn/ckeditor_bundle.rb', line 8 def translations @translations end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
8 9 10 |
# File 'lib/ckeditor5/rails/cdn/ckeditor_bundle.rb', line 8 def version @version end |
Instance Method Details
#scripts ⇒ Object
23 24 25 26 27 28 |
# File 'lib/ckeditor5/rails/cdn/ckeditor_bundle.rb', line 23 def scripts @scripts ||= [ , * ] end |
#stylesheets ⇒ Object
30 31 32 33 34 |
# File 'lib/ckeditor5/rails/cdn/ckeditor_bundle.rb', line 30 def stylesheets @stylesheets ||= [ create_cdn_url(import_name, version, "#{import_name}.css") ] end |