Class: WebpackManifest::Rails::Configuration
- Inherits:
-
Object
- Object
- WebpackManifest::Rails::Configuration
- Defined in:
- lib/webpack_manifest/rails/configuration.rb
Instance Attribute Summary collapse
-
#manifests ⇒ Object
readonly
Returns the value of attribute manifests.
Instance Method Summary collapse
-
#add(key, path) ⇒ Object
Register a manfiest.
- #cache ⇒ Object
- #cache=(v) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#manifest=(path) ⇒ Object
Register a single manifest as a default.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 |
# File 'lib/webpack_manifest/rails/configuration.rb', line 8 def initialize # default values @cache = false @manifests = ManifestRepository.new end |
Instance Attribute Details
#manifests ⇒ Object (readonly)
Returns the value of attribute manifests.
6 7 8 |
# File 'lib/webpack_manifest/rails/configuration.rb', line 6 def manifests @manifests end |
Instance Method Details
#add(key, path) ⇒ Object
Register a manfiest. You can register multiple files by calling ‘#add`.
29 30 31 |
# File 'lib/webpack_manifest/rails/configuration.rb', line 29 def add(key, path) @manifests.add(key, path, cache: @cache) end |
#cache ⇒ Object
14 15 16 |
# File 'lib/webpack_manifest/rails/configuration.rb', line 14 def cache @cache end |
#cache=(v) ⇒ Object
18 19 20 21 |
# File 'lib/webpack_manifest/rails/configuration.rb', line 18 def cache=(v) @manifests.all_manifests.each { |m| m.cache = v } @cache = v end |
#manifest=(path) ⇒ Object
Register a single manifest as a default.
24 25 26 |
# File 'lib/webpack_manifest/rails/configuration.rb', line 24 def manifest=(path) @manifests.default = @manifests.add '', path, cache: @cache end |