Class: CarthageCache::CartfileResolvedFile
- Inherits:
-
Object
- Object
- CarthageCache::CartfileResolvedFile
- Defined in:
- lib/carthage_cache/carthage_resolved_file.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
Instance Method Summary collapse
- #content ⇒ Object
- #digest ⇒ Object
-
#initialize(file_path) ⇒ CartfileResolvedFile
constructor
A new instance of CartfileResolvedFile.
Constructor Details
#initialize(file_path) ⇒ CartfileResolvedFile
Returns a new instance of CartfileResolvedFile.
9 10 11 |
# File 'lib/carthage_cache/carthage_resolved_file.rb', line 9 def initialize(file_path) @file_path = file_path end |
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
7 8 9 |
# File 'lib/carthage_cache/carthage_resolved_file.rb', line 7 def file_path @file_path end |
Instance Method Details
#content ⇒ Object
17 18 19 |
# File 'lib/carthage_cache/carthage_resolved_file.rb', line 17 def content @content ||= File.read(file_path) end |
#digest ⇒ Object
13 14 15 |
# File 'lib/carthage_cache/carthage_resolved_file.rb', line 13 def digest @digest ||= Digest::SHA256.hexdigest(content) end |