Class: Given::FileCache
- Inherits:
-
Object
- Object
- Given::FileCache
- Defined in:
- lib/given/file_cache.rb
Instance Method Summary collapse
- #get(file_name) ⇒ Object
-
#initialize ⇒ FileCache
constructor
A new instance of FileCache.
Constructor Details
#initialize ⇒ FileCache
Returns a new instance of FileCache.
4 5 6 |
# File 'lib/given/file_cache.rb', line 4 def initialize @lines = {} end |
Instance Method Details
#get(file_name) ⇒ Object
8 9 10 |
# File 'lib/given/file_cache.rb', line 8 def get(file_name) @lines[file_name] ||= read_lines(file_name) end |