Class: I18nLocales::Pair
- Inherits:
-
Object
- Object
- I18nLocales::Pair
- Defined in:
- lib/i18n_locales.rb
Instance Attribute Summary collapse
-
#country ⇒ Object
Returns the value of attribute country.
-
#format ⇒ Object
Returns the value of attribute format.
-
#language ⇒ Object
Returns the value of attribute language.
Instance Method Summary collapse
-
#initialize(country, language, format = nil) ⇒ Pair
constructor
A new instance of Pair.
- #to_s ⇒ Object
Constructor Details
#initialize(country, language, format = nil) ⇒ Pair
Returns a new instance of Pair.
59 60 61 62 63 |
# File 'lib/i18n_locales.rb', line 59 def initialize(country, language, format=nil) @country = country @language = language @format = format || I18nLocales.format end |
Instance Attribute Details
#country ⇒ Object
Returns the value of attribute country.
57 58 59 |
# File 'lib/i18n_locales.rb', line 57 def country @country end |
#format ⇒ Object
Returns the value of attribute format.
57 58 59 |
# File 'lib/i18n_locales.rb', line 57 def format @format end |
#language ⇒ Object
Returns the value of attribute language.
57 58 59 |
# File 'lib/i18n_locales.rb', line 57 def language @language end |
Instance Method Details
#to_s ⇒ Object
65 66 67 68 69 70 71 |
# File 'lib/i18n_locales.rb', line 65 def to_s format.gsub('%C', country.upcase) .gsub('%L', language.upcase) .gsub('%c', country.downcase) .gsub('%l', language.downcase) .gsub('%%', '%') end |