Class: I18n::Index::Base

Inherits:
Object show all
Defined in:
lib/i18n/index/base.rb

Direct Known Subclasses

Simple

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



8
9
10
11
12
# File 'lib/i18n/index/base.rb', line 8

def initialize(options = {})
  @root_dir = options[:root_dir] || Dir.pwd
  @pattern = options[:pattern] || Index.pattern
  options[:format].setup(self) if options[:format]
end

Instance Attribute Details

#patternObject

Returns the value of attribute pattern.



6
7
8
# File 'lib/i18n/index/base.rb', line 6

def pattern
  @pattern
end

#root_dirObject

Returns the value of attribute root_dir.



6
7
8
# File 'lib/i18n/index/base.rb', line 6

def root_dir
  @root_dir
end

Instance Method Details

#filenamesObject



14
15
16
# File 'lib/i18n/index/base.rb', line 14

def filenames
  Dir[root_dir + '/' + pattern]
end

#filesObject



18
19
20
# File 'lib/i18n/index/base.rb', line 18

def files
  @files ||= Files.new
end