Class: I18nChecker::Cache::Files

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/i18n_checker/cache.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(files = {}) ⇒ Files

Returns a new instance of Files.



14
15
16
# File 'lib/i18n_checker/cache.rb', line 14

def initialize(files = {})
  @files = files
end

Instance Attribute Details

#filesObject (readonly)

Returns the value of attribute files.



10
11
12
# File 'lib/i18n_checker/cache.rb', line 10

def files
  @files
end

Instance Method Details

#read(file) ⇒ Object



18
19
20
21
22
# File 'lib/i18n_checker/cache.rb', line 18

def read(file)
  return files[file] if files.key?(file)
  files[file] = I18nChecker::Cache::File.of(file)
  files[file]
end