Class: CKEditor5::Rails::Assets::JSUrlImportMeta
- Inherits:
-
Object
- Object
- CKEditor5::Rails::Assets::JSUrlImportMeta
- Defined in:
- lib/ckeditor5/rails/assets/assets_bundle.rb
Instance Attribute Summary collapse
-
#import_meta ⇒ Object
readonly
Returns the value of attribute import_meta.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, translation: false, **import_options) ⇒ JSUrlImportMeta
constructor
A new instance of JSUrlImportMeta.
- #preloads ⇒ Object
- #to_h ⇒ Object
- #translation? ⇒ Boolean
Constructor Details
#initialize(url, translation: false, **import_options) ⇒ JSUrlImportMeta
Returns a new instance of JSUrlImportMeta.
53 54 55 56 57 |
# File 'lib/ckeditor5/rails/assets/assets_bundle.rb', line 53 def initialize(url, translation: false, **) @url = url @import_meta = JSImportMeta.new(**) @translation = translation end |
Instance Attribute Details
#import_meta ⇒ Object (readonly)
Returns the value of attribute import_meta.
49 50 51 |
# File 'lib/ckeditor5/rails/assets/assets_bundle.rb', line 49 def @import_meta end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
49 50 51 |
# File 'lib/ckeditor5/rails/assets/assets_bundle.rb', line 49 def url @url end |
Instance Method Details
#preloads ⇒ Object
70 71 72 73 74 75 76 |
# File 'lib/ckeditor5/rails/assets/assets_bundle.rb', line 70 def preloads { as: 'script', rel: esm? ? 'modulepreload' : 'preload', href: url } end |
#to_h ⇒ Object
63 64 65 66 67 68 |
# File 'lib/ckeditor5/rails/assets/assets_bundle.rb', line 63 def to_h .to_h.merge({ url: url, translation: translation? }) end |
#translation? ⇒ Boolean
59 60 61 |
# File 'lib/ckeditor5/rails/assets/assets_bundle.rb', line 59 def translation? @translation end |