Class: CLDR::Resource
- Inherits:
-
Object
- Object
- CLDR::Resource
- Defined in:
- lib/cldr/resource.rb
Overview
An abstract class of Resoureces
Instance Method Summary collapse
-
#initialize(locale, fallback, textdomain) ⇒ Resource
constructor
:nodoc:.
Constructor Details
#initialize(locale, fallback, textdomain) ⇒ Resource
:nodoc:
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/cldr/resource.rb', line 15 def initialize(locale, fallback, textdomain) #:nodoc: script = "" [locale.to_simple, locale.to_s, locale.language, fallback.to_simple].each do |v| path = File.join(RESOURCE_DIR, v, "#{textdomain}.rb") if FileTest.file?(path) File.open(path){|v| script = v.read} break end end self.class.class_eval(script) init_data end |