Class: TwitterCldr::Resources::CldrDataBuilder
- Inherits:
-
Object
- Object
- TwitterCldr::Resources::CldrDataBuilder
- Defined in:
- lib/twitter_cldr/resources/cldr_data_builder.rb
Constant Summary collapse
- DEEP_MERGER =
proc do |key, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &DEEP_MERGER) : (v2 || v1) end
Instance Attribute Summary collapse
-
#cldr_locale ⇒ Object
readonly
Returns the value of attribute cldr_locale.
Instance Method Summary collapse
-
#initialize(cldr_locale) ⇒ CldrDataBuilder
constructor
A new instance of CldrDataBuilder.
- #merge_each_ancestor ⇒ Object
Constructor Details
#initialize(cldr_locale) ⇒ CldrDataBuilder
Returns a new instance of CldrDataBuilder.
18 19 20 |
# File 'lib/twitter_cldr/resources/cldr_data_builder.rb', line 18 def initialize(cldr_locale) @cldr_locale = cldr_locale end |
Instance Attribute Details
#cldr_locale ⇒ Object (readonly)
Returns the value of attribute cldr_locale.
16 17 18 |
# File 'lib/twitter_cldr/resources/cldr_data_builder.rb', line 16 def cldr_locale @cldr_locale end |
Instance Method Details
#merge_each_ancestor ⇒ Object
22 23 24 25 26 |
# File 'lib/twitter_cldr/resources/cldr_data_builder.rb', line 22 def merge_each_ancestor cldr_locale.ancestors.inject({}) do |result, ancestor_locale| deep_merge(yield(ancestor_locale), result) end end |