Class: CarthageCache::CartfileResolvedFile

Inherits:
Object
  • Object
show all
Defined in:
lib/carthage_cache/carthage_resolved_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pathObject (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

#contentObject



17
18
19
# File 'lib/carthage_cache/carthage_resolved_file.rb', line 17

def content
  @content ||= File.read(file_path)
end

#digestObject



13
14
15
# File 'lib/carthage_cache/carthage_resolved_file.rb', line 13

def digest
  @digest ||= Digest::SHA256.hexdigest(content)
end