Class: Dassets::Config
- Inherits:
-
Object
- Object
- Dassets::Config
- Includes:
- NsOptions::Proxy
- Defined in:
- lib/dassets/config.rb
Instance Attribute Summary collapse
-
#combinations ⇒ Object
readonly
Returns the value of attribute combinations.
-
#sources ⇒ Object
readonly
Returns the value of attribute sources.
Instance Method Summary collapse
- #base_url(value = nil) ⇒ Object
- #combination(key_digest_path, value_digest_paths) ⇒ Object
- #combination?(key_digest_path) ⇒ Boolean
- #content_cache(cache = nil) ⇒ Object
- #fingerprint_cache(cache = nil) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #set_base_url(value) ⇒ Object
- #source(path, &block) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
16 17 18 19 20 21 22 |
# File 'lib/dassets/config.rb', line 16 def initialize super @sources = [] @combinations = Hash.new{ |h, k| [k] } # digest pass-thru if none defined @content_cache = Dassets::Cache::NoCache.new @fingerprint_cache = Dassets::Cache::NoCache.new end |
Instance Attribute Details
#combinations ⇒ Object (readonly)
Returns the value of attribute combinations.
14 15 16 |
# File 'lib/dassets/config.rb', line 14 def combinations @combinations end |
#sources ⇒ Object (readonly)
Returns the value of attribute sources.
14 15 16 |
# File 'lib/dassets/config.rb', line 14 def sources @sources end |
Instance Method Details
#base_url(value = nil) ⇒ Object
24 25 26 27 |
# File 'lib/dassets/config.rb', line 24 def base_url(value = nil) set_base_url(value) if !value.nil? @base_url end |
#combination(key_digest_path, value_digest_paths) ⇒ Object
47 48 49 |
# File 'lib/dassets/config.rb', line 47 def combination(key_digest_path, value_digest_paths) @combinations[key_digest_path.to_s] = [*value_digest_paths] end |
#combination?(key_digest_path) ⇒ Boolean
51 52 53 54 55 |
# File 'lib/dassets/config.rb', line 51 def combination?(key_digest_path) # a digest path is only considered a combination is it is not the default # pass-thru above @combinations[key_digest_path.to_s] != [key_digest_path] end |
#content_cache(cache = nil) ⇒ Object
33 34 35 36 |
# File 'lib/dassets/config.rb', line 33 def content_cache(cache = nil) @content_cache = cache if !cache.nil? @content_cache end |
#fingerprint_cache(cache = nil) ⇒ Object
38 39 40 41 |
# File 'lib/dassets/config.rb', line 38 def fingerprint_cache(cache = nil) @fingerprint_cache = cache if !cache.nil? @fingerprint_cache end |
#set_base_url(value) ⇒ Object
29 30 31 |
# File 'lib/dassets/config.rb', line 29 def set_base_url(value) @base_url = value end |