Class: I18nLookup

Inherits:
Object
  • Object
show all
Defined in:
lib/forge/app/models/i18n_lookup.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass) ⇒ I18nLookup

Returns a new instance of I18nLookup.



2
3
4
# File 'lib/forge/app/models/i18n_lookup.rb', line 2

def initialize(klass)
  @klass = klass
end

Class Method Details

.fieldsObject



10
11
12
# File 'lib/forge/app/models/i18n_lookup.rb', line 10

def self.fields
  @@fields ||= YAML::load(File.open(Rails.root + 'config/i18n_fields.yml')).recursive_symbolize_keys!
end

Instance Method Details

#fieldsObject



6
7
8
# File 'lib/forge/app/models/i18n_lookup.rb', line 6

def fields
  self.class.fields[:tables][@klass.to_s.underscore.pluralize.to_sym]
end