Class: I18nChecker::Cache::File

Inherits:
Object
  • Object
show all
Defined in:
lib/i18n_checker/cache.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, lines) ⇒ File

Returns a new instance of File.



34
35
36
37
# File 'lib/i18n_checker/cache.rb', line 34

def initialize(file, lines)
  @file = file
  @lines = lines
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



26
27
28
# File 'lib/i18n_checker/cache.rb', line 26

def file
  @file
end

#linesObject (readonly)

Returns the value of attribute lines.



26
27
28
# File 'lib/i18n_checker/cache.rb', line 26

def lines
  @lines
end

Class Method Details

.of(file) ⇒ Object



29
30
31
# File 'lib/i18n_checker/cache.rb', line 29

def of(file)
  new(file, Lines.of(::File.read(file)))
end

Instance Method Details

#[](scope) ⇒ Object



39
40
41
# File 'lib/i18n_checker/cache.rb', line 39

def [](scope)
  lines[scope]
end

#to_sObject



43
44
45
# File 'lib/i18n_checker/cache.rb', line 43

def to_s
  lines.to_s
end