Class: TwitterCldr::LocalizedObject
- Inherits:
-
Object
- Object
- TwitterCldr::LocalizedObject
- Defined in:
- lib/twitter_cldr/core_ext/localized_object.rb
Direct Known Subclasses
LocalizedArray, LocalizedDateTime, LocalizedNumber, LocalizedString, LocalizedSymbol, LocalizedTimespan
Instance Attribute Summary collapse
-
#base_obj ⇒ Object
readonly
Returns the value of attribute base_obj.
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
Instance Method Summary collapse
- #formatter_const ⇒ Object
-
#initialize(obj, locale, options = {}) ⇒ LocalizedObject
constructor
A new instance of LocalizedObject.
Constructor Details
#initialize(obj, locale, options = {}) ⇒ LocalizedObject
Returns a new instance of LocalizedObject.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/twitter_cldr/core_ext/localized_object.rb', line 10 def initialize(obj, locale, = {}) @base_obj = obj @locale = TwitterCldr.convert_locale(locale) @locale = TwitterCldr::DEFAULT_LOCALE unless TwitterCldr.supported_locale?(@locale) = .dup [:locale] = @locale @formatter = formatter_const.new() if formatter_const end |
Instance Attribute Details
#base_obj ⇒ Object (readonly)
Returns the value of attribute base_obj.
8 9 10 |
# File 'lib/twitter_cldr/core_ext/localized_object.rb', line 8 def base_obj @base_obj end |
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
8 9 10 |
# File 'lib/twitter_cldr/core_ext/localized_object.rb', line 8 def formatter @formatter end |
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
8 9 10 |
# File 'lib/twitter_cldr/core_ext/localized_object.rb', line 8 def locale @locale end |
Instance Method Details
#formatter_const ⇒ Object
21 22 23 |
# File 'lib/twitter_cldr/core_ext/localized_object.rb', line 21 def formatter_const raise NotImplementedError end |