Class: Dassets::NullSourceFile
- Inherits:
-
SourceFile
- Object
- SourceFile
- Dassets::NullSourceFile
- Defined in:
- lib/dassets/source_file.rb
Overview
A null source file is used to represent source that either doesn’t exist or source that is a proxy (ie a combination)
Defined Under Namespace
Classes: NullSourceProxy
Instance Attribute Summary
Attributes inherited from SourceFile
Instance Method Summary collapse
- #==(other_source_file) ⇒ Object
- #compiled ⇒ Object
- #exists? ⇒ Boolean
-
#initialize(digest_path, cache = nil) ⇒ NullSourceFile
constructor
A new instance of NullSourceFile.
- #mtime ⇒ Object
Methods inherited from SourceFile
#asset_file, #digest_path, find_by_digest_path, #source
Constructor Details
#initialize(digest_path, cache = nil) ⇒ NullSourceFile
Returns a new instance of NullSourceFile.
89 90 91 92 93 94 95 96 97 |
# File 'lib/dassets/source_file.rb', line 89 def initialize(digest_path, cache = nil) @file_path, @ext_list = '', [] @digest_path = digest_path @source_proxy = if Dassets.config.combination?(@digest_path) SourceProxy.new(@digest_path, cache) else NullSourceProxy.new end end |
Instance Method Details
#==(other_source_file) ⇒ Object
103 104 105 |
# File 'lib/dassets/source_file.rb', line 103 def ==(other_source_file) self.file_path == other_source_file.file_path end |
#compiled ⇒ Object
99 |
# File 'lib/dassets/source_file.rb', line 99 def compiled; @source_proxy.content; end |
#exists? ⇒ Boolean
100 |
# File 'lib/dassets/source_file.rb', line 100 def exists?; @source_proxy.exists?; end |
#mtime ⇒ Object
101 |
# File 'lib/dassets/source_file.rb', line 101 def mtime; @source_proxy.mtime; end |