Class: Dassets::Config
- Inherits:
-
Object
- Object
- Dassets::Config
- 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
- #file_store(value = nil) ⇒ Object
- #fingerprint_cache(cache = nil) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #reset ⇒ Object
- #set_base_url(value) ⇒ Object
- #source(path, &block) ⇒ Object
Constructor Details
Instance Attribute Details
#combinations ⇒ Object (readonly)
Returns the value of attribute combinations.
10 11 12 |
# File 'lib/dassets/config.rb', line 10 def combinations @combinations end |
#sources ⇒ Object (readonly)
Returns the value of attribute sources.
10 11 12 |
# File 'lib/dassets/config.rb', line 10 def sources @sources end |
Instance Method Details
#base_url(value = nil) ⇒ Object
25 26 27 28 |
# File 'lib/dassets/config.rb', line 25 def base_url(value = nil) set_base_url(value) if !value.nil? @base_url end |
#combination(key_digest_path, value_digest_paths) ⇒ Object
55 56 57 |
# File 'lib/dassets/config.rb', line 55 def combination(key_digest_path, value_digest_paths) @combinations[key_digest_path.to_s] = [*value_digest_paths] end |
#combination?(key_digest_path) ⇒ Boolean
59 60 61 62 63 |
# File 'lib/dassets/config.rb', line 59 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
41 42 43 44 |
# File 'lib/dassets/config.rb', line 41 def content_cache(cache = nil) @content_cache = cache if !cache.nil? @content_cache end |
#file_store(value = nil) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/dassets/config.rb', line 34 def file_store(value = nil) if !value.nil? @file_store = (value.kind_of?(FileStore) ? value : FileStore.new(value)) end @file_store end |
#fingerprint_cache(cache = nil) ⇒ Object
46 47 48 49 |
# File 'lib/dassets/config.rb', line 46 def fingerprint_cache(cache = nil) @fingerprint_cache = cache if !cache.nil? @fingerprint_cache end |
#reset ⇒ Object
20 21 22 23 |
# File 'lib/dassets/config.rb', line 20 def reset @sources = [] @combinations = Hash.new{ |h, k| [k] } # digest pass-thru if none defined end |
#set_base_url(value) ⇒ Object
30 31 32 |
# File 'lib/dassets/config.rb', line 30 def set_base_url(value) @base_url = value end |