Class: Trackler::GuaranteedFile

Inherits:
Object
  • Object
show all
Defined in:
lib/trackler/guaranteed_file.rb

Direct Known Subclasses

CommonFile, NullFile, TrackFile

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#contentObject

Returns the value of attribute content.



3
4
5
# File 'lib/trackler/guaranteed_file.rb', line 3

def content
  @content
end

Class Method Details

.for(specification:, track:, filename:) ⇒ Object



5
6
7
8
9
# File 'lib/trackler/guaranteed_file.rb', line 5

def self.for(specification:, track:, filename:)
  [TrackFile, CommonFile].detect(-> {NullFile}) do |d|
    d.send(:exists?, specification: specification, track: track, filename: filename)
  end.send(:new, specification: specification, track: track, filename: filename)
end