Class: CKEditor5::Rails::Cdn::CKBoxBundle
- Inherits:
-
Assets::AssetsBundle
- Object
- Assets::AssetsBundle
- CKEditor5::Rails::Cdn::CKBoxBundle
- Includes:
- UrlGenerator
- Defined in:
- lib/ckeditor5/rails/cdn/ckbox_bundle.rb
Constant Summary
Constants included from UrlGenerator
UrlGenerator::CDN_COMMERCIAL_GENERATORS, UrlGenerator::CDN_THIRD_PARTY_GENERATORS
Instance Attribute Summary collapse
-
#cdn ⇒ Object
readonly
Returns the value of attribute cdn.
-
#theme ⇒ Object
readonly
Returns the value of attribute theme.
-
#translations ⇒ Object
readonly
Returns the value of attribute translations.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(version, theme: :lark, cdn: Engine.default_preset.cdn, translations: []) ⇒ CKBoxBundle
constructor
A new instance of CKBoxBundle.
- #scripts ⇒ Object
- #stylesheets ⇒ Object
Methods included from UrlGenerator
Methods inherited from Assets::AssetsBundle
#<<, #empty?, #preloads, #to_json, #translations_scripts
Constructor Details
#initialize(version, theme: :lark, cdn: Engine.default_preset.cdn, translations: []) ⇒ CKBoxBundle
Returns a new instance of CKBoxBundle.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ckeditor5/rails/cdn/ckbox_bundle.rb', line 10 def initialize(version, theme: :lark, cdn: Engine.default_preset.cdn, translations: []) super() @cdn = cdn @version = version @theme = theme @translations = translations validate! end |
Instance Attribute Details
#cdn ⇒ Object (readonly)
Returns the value of attribute cdn.
8 9 10 |
# File 'lib/ckeditor5/rails/cdn/ckbox_bundle.rb', line 8 def cdn @cdn end |
#theme ⇒ Object (readonly)
Returns the value of attribute theme.
8 9 10 |
# File 'lib/ckeditor5/rails/cdn/ckbox_bundle.rb', line 8 def theme @theme end |
#translations ⇒ Object (readonly)
Returns the value of attribute translations.
8 9 10 |
# File 'lib/ckeditor5/rails/cdn/ckbox_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/ckbox_bundle.rb', line 8 def version @version end |
Instance Method Details
#scripts ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/ckeditor5/rails/cdn/ckbox_bundle.rb', line 21 def scripts @scripts ||= [ Assets::JSUrlImportMeta.new( create_cdn_url('ckbox', version, 'ckbox.js'), window_name: 'CKBox' ), *translations_js_url_imports ] end |
#stylesheets ⇒ Object
31 32 33 34 35 |
# File 'lib/ckeditor5/rails/cdn/ckbox_bundle.rb', line 31 def stylesheets @stylesheets ||= [ create_cdn_url('ckbox', version, "styles/themes/#{theme}.css") ] end |