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, options = nil) ⇒ NullSourceFile
constructor
A new instance of NullSourceFile.
- #mtime ⇒ Object
Methods inherited from SourceFile
#asset_file, #digest_path, find_by_digest_path, #response_headers, #source
Constructor Details
#initialize(digest_path, options = nil) ⇒ NullSourceFile
Returns a new instance of NullSourceFile.
93 94 95 96 97 98 99 100 101 |
# File 'lib/dassets/source_file.rb', line 93 def initialize(digest_path, = nil) @file_path, @ext_list = '', [] @digest_path = digest_path @source_proxy = if Dassets.config.combination?(@digest_path) SourceProxy.new(@digest_path, ) else NullSourceProxy.new end end |
Instance Method Details
#==(other_source_file) ⇒ Object
107 108 109 |
# File 'lib/dassets/source_file.rb', line 107 def ==(other_source_file) self.file_path == other_source_file.file_path end |
#compiled ⇒ Object
103 |
# File 'lib/dassets/source_file.rb', line 103 def compiled; @source_proxy.content; end |
#exists? ⇒ Boolean
104 |
# File 'lib/dassets/source_file.rb', line 104 def exists?; @source_proxy.exists?; end |
#mtime ⇒ Object
105 |
# File 'lib/dassets/source_file.rb', line 105 def mtime; @source_proxy.mtime; end |