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, #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 20 21 |
# File 'lib/ckeditor5/rails/cdn/ckbox_bundle.rb', line 10 def initialize(version, theme: :lark, cdn: Engine.default_preset.cdn, translations: []) raise ArgumentError, 'version must be semver' unless version.is_a?(Semver) raise ArgumentError, 'theme must be a string' unless theme.is_a?(String) raise ArgumentError, 'translations must be an array' unless translations.is_a?(Array) super() @cdn = cdn @version = version @theme = theme @translations = translations 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
23 24 25 26 27 28 29 30 |
# File 'lib/ckeditor5/rails/cdn/ckbox_bundle.rb', line 23 def scripts @scripts ||= [ Assets::JSExportsMeta.new( create_cdn_url('ckbox', 'ckbox.js', version), * ) ] end |
#stylesheets ⇒ Object
32 33 34 35 36 |
# File 'lib/ckeditor5/rails/cdn/ckbox_bundle.rb', line 32 def stylesheets @stylesheets ||= [ create_cdn_url('ckbox', "styles/themes/#{theme}.css", version) ] end |