Class: CKEditor5::Rails::Assets::AssetsBundle

Inherits:
Object
  • Object
show all
Defined in:
lib/ckeditor5/rails/assets/assets_bundle.rb

Direct Known Subclasses

Cdn::CKBoxBundle, Cdn::CKEditorBundle

Instance Method Summary collapse

Constructor Details

#initializeAssetsBundle

Returns a new instance of AssetsBundle.



7
8
9
# File 'lib/ckeditor5/rails/assets/assets_bundle.rb', line 7

def initialize
  validate_implementation!
end

Instance Method Details

#<<(other) ⇒ Object

Raises:

  • (TypeError)


23
24
25
26
27
28
# File 'lib/ckeditor5/rails/assets/assets_bundle.rb', line 23

def <<(other)
  raise TypeError, 'other must be an instance of AssetsBundle' unless other.is_a?(AssetsBundle)

  @scripts = scripts + other.scripts
  @stylesheets = stylesheets + other.stylesheets
end

#empty?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/ckeditor5/rails/assets/assets_bundle.rb', line 11

def empty?
  scripts.empty? && stylesheets.empty?
end

#preloadsObject



19
20
21
# File 'lib/ckeditor5/rails/assets/assets_bundle.rb', line 19

def preloads
  stylesheets + scripts.map(&:url)
end

#translations_scriptsObject



15
16
17
# File 'lib/ckeditor5/rails/assets/assets_bundle.rb', line 15

def translations_scripts
  scripts.select(&:translation?)
end