Class: TwitterCldr::Js::Renderers::TestRenderers::TestHelpers::RBNFHelperRenderer

Inherits:
Base
  • Object
show all
Defined in:
lib/twitter_cldr/js/renderers/test_helpers/rbnf_helper_renderer.rb

Instance Attribute Summary

Attributes inherited from Base

#locale

Instance Method Summary collapse

Methods inherited from Base

#initialize, set_template

Constructor Details

This class inherits a constructor from TwitterCldr::Js::Renderers::Base

Instance Method Details

#allowed_failuresObject



30
31
32
33
34
# File 'lib/twitter_cldr/js/renderers/test_helpers/rbnf_helper_renderer.rb', line 30

def allowed_failures
  file_path = File.join(File.dirname(TwitterCldr::RESOURCES_DIR), '/spec/formatters/numbers/rbnf/allowed_failures.yml')
  result = YAML.load_file(file_path)
  result.to_json
end

#global_resourceObject



15
16
17
18
19
20
# File 'lib/twitter_cldr/js/renderers/test_helpers/rbnf_helper_renderer.rb', line 15

def global_resource
  TwitterCldr.supported_locales.inject({}) do |result, locale|
    result[locale] = TwitterCldr.resources.get_locale_resource(locale, "rbnf")[locale][:rbnf][:grouping]
    result
  end.to_json
end

#test_resourceObject



22
23
24
25
26
27
28
# File 'lib/twitter_cldr/js/renderers/test_helpers/rbnf_helper_renderer.rb', line 22

def test_resource
  TwitterCldr.supported_locales.inject({}) do |result, locale|
    file_path = File.join(File.dirname(TwitterCldr::RESOURCES_DIR), 'spec/formatters/numbers/rbnf/locales', locale.to_s, 'rbnf_test.yml')
    result[locale] = YAML.load_file(file_path)
    result
  end.to_json
end