Class: TwitterCldr::Shared::Unit
- Inherits:
-
Object
- Object
- TwitterCldr::Shared::Unit
- Defined in:
- lib/twitter_cldr/shared/unit.rb
Constant Summary collapse
- DEFAULT_FORM =
:long
Instance Attribute Summary collapse
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(value, locale = TwitterCldr.locale) ⇒ Unit
constructor
A new instance of Unit.
- #unit_types ⇒ Object
Constructor Details
#initialize(value, locale = TwitterCldr.locale) ⇒ Unit
Returns a new instance of Unit.
83 84 85 86 |
# File 'lib/twitter_cldr/shared/unit.rb', line 83 def initialize(value, locale = TwitterCldr.locale) @value = value @locale = locale end |
Instance Attribute Details
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
81 82 83 |
# File 'lib/twitter_cldr/shared/unit.rb', line 81 def locale @locale end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
81 82 83 |
# File 'lib/twitter_cldr/shared/unit.rb', line 81 def value @value end |
Class Method Details
.create(value, locale = TwitterCldr.locale) ⇒ Object
12 13 14 |
# File 'lib/twitter_cldr/shared/unit.rb', line 12 def create(value, locale = TwitterCldr.locale) subtype_for(locale).new(value, locale) end |
Instance Method Details
#unit_types ⇒ Object
88 89 90 |
# File 'lib/twitter_cldr/shared/unit.rb', line 88 def unit_types self.class.send(:all_unit_methods_for, locale) end |