Module: Worldwide

Defined in:
lib/worldwide.rb,
lib/worldwide/zip.rb,
lib/worldwide/cldr.rb,
lib/worldwide/util.rb,
lib/worldwide/field.rb,
lib/worldwide/lists.rb,
lib/worldwide/names.rb,
lib/worldwide/paths.rb,
lib/worldwide/phone.rb,
lib/worldwide/units.rb,
lib/worldwide/config.rb,
lib/worldwide/fields.rb,
lib/worldwide/locale.rb,
lib/worldwide/region.rb,
lib/worldwide/address.rb,
lib/worldwide/locales.rb,
lib/worldwide/numbers.rb,
lib/worldwide/plurals.rb,
lib/worldwide/regions.rb,
lib/worldwide/scripts.rb,
lib/worldwide/version.rb,
lib/worldwide/calendar.rb,
lib/worldwide/currency.rb,
lib/worldwide/discounts.rb,
lib/worldwide/time_zone.rb,
lib/worldwide/currencies.rb,
lib/worldwide/punctuation.rb,
lib/worldwide/rails/railtie.rb,
lib/worldwide/cldr/fallbacks.rb,
lib/worldwide/regions_loader.rb,
lib/worldwide/time_formatter.rb,
lib/worldwide/extant_outcodes.rb,
lib/worldwide/ruby_i18n_config.rb,
lib/worldwide/address_validator.rb,
lib/worldwide/calendar/gregorian.rb,
lib/worldwide/pluralization_helper.rb,
lib/worldwide/i18n_exception_handler.rb,
lib/worldwide/cldr/context_transforms.rb,
lib/worldwide/cldr/date_format_pattern.rb,
lib/worldwide/deprecated_time_zone_mapper.rb

Defined Under Namespace

Modules: Calendar, Cldr, Config, Currencies, Lists, Locales, Paths, PluralizationHelper, Plurals, Rails, Scripts, Zip Classes: Address, AddressValidator, Currency, DeprecatedTimeZoneMapper, Discounts, ExtantOutcodes, Field, Fields, I18nExceptionHandler, Locale, Names, Numbers, Phone, Punctuation, Region, Regions, RegionsLoader, RubyI18nConfig, TimeFormatter, TimeZone, Units, Util

Constant Summary collapse

VERSION =
"1.20.1"

Class Method Summary collapse

Class Method Details

.address(**kwargs) ⇒ Object



53
54
55
# File 'lib/worldwide.rb', line 53

def address(**kwargs)
  Address.new(**kwargs)
end

.currency(code:) ⇒ Object



57
58
59
60
# File 'lib/worldwide.rb', line 57

def currency(code:)
  currency_code = code.to_s.upcase.rjust(3, "0")
  @currencies_cache[currency_code] ||= Currency.new(code: currency_code)
end

.discountsObject



62
63
64
# File 'lib/worldwide.rb', line 62

def discounts
  Discounts
end

.eager_load!Object



49
50
51
# File 'lib/worldwide.rb', line 49

def eager_load!
  Regions.instance
end

.listsObject



74
75
76
# File 'lib/worldwide.rb', line 74

def lists
  Lists
end

.locale(code:) ⇒ Object



66
67
68
# File 'lib/worldwide.rb', line 66

def locale(code:)
  @locales_cache[code] ||= Locale.new(code)
end

.localesObject



70
71
72
# File 'lib/worldwide.rb', line 70

def locales
  Locales
end

.namesObject



78
79
80
# File 'lib/worldwide.rb', line 78

def names
  Names
end

.numbersObject



82
83
84
# File 'lib/worldwide.rb', line 82

def numbers
  Numbers
end

.pluralsObject



86
87
88
# File 'lib/worldwide.rb', line 86

def plurals
  Plurals
end

.punctuationObject



90
91
92
# File 'lib/worldwide.rb', line 90

def punctuation
  Punctuation
end

.region(**kwargs) ⇒ Object



98
99
100
# File 'lib/worldwide.rb', line 98

def region(**kwargs)
  Regions.region(**kwargs)
end

.region_by_cldr_code(**kwargs) ⇒ Object



94
95
96
# File 'lib/worldwide.rb', line 94

def region_by_cldr_code(**kwargs)
  Regions.region_by_cldr_code(**kwargs)
end

.scriptsObject



102
103
104
# File 'lib/worldwide.rb', line 102

def scripts
  Scripts
end

.time_zoneObject



106
107
108
# File 'lib/worldwide.rb', line 106

def time_zone
  TimeZone
end

.unitsObject



114
115
116
# File 'lib/worldwide.rb', line 114

def units
  Units
end

.unknown_regionObject



110
111
112
# File 'lib/worldwide.rb', line 110

def unknown_region
  region(code: "ZZ")
end