Class: TwitterCldr::Localized::LocalizedArray
- Inherits:
-
LocalizedObject
- Object
- LocalizedObject
- TwitterCldr::Localized::LocalizedArray
- Includes:
- Enumerable
- Defined in:
- lib/twitter_cldr/localized/localized_array.rb
Instance Attribute Summary
Attributes inherited from LocalizedObject
#base_obj, #formatter, #locale
Instance Method Summary collapse
- #code_points_to_string ⇒ Object
- #each ⇒ Object
- #formatter_const ⇒ Object
- #sort ⇒ Object
- #sort! ⇒ Object
- #to_a ⇒ Object
- #to_sentence ⇒ Object
- #to_yaml(options = {}) ⇒ Object
Methods inherited from LocalizedObject
Constructor Details
This class inherits a constructor from TwitterCldr::Localized::LocalizedObject
Instance Method Details
#code_points_to_string ⇒ Object
12 13 14 |
# File 'lib/twitter_cldr/localized/localized_array.rb', line 12 def code_points_to_string TwitterCldr::Utils::CodePoints.to_string(base_obj) end |
#each ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/twitter_cldr/localized/localized_array.rb', line 37 def each if block_given? @base_obj.each { |val| yield val } else @base_obj.to_enum end end |
#formatter_const ⇒ Object
25 26 27 |
# File 'lib/twitter_cldr/localized/localized_array.rb', line 25 def formatter_const nil end |
#sort ⇒ Object
16 17 18 |
# File 'lib/twitter_cldr/localized/localized_array.rb', line 16 def sort TwitterCldr::Collation::Collator.new(locale).sort(base_obj).localize end |
#sort! ⇒ Object
20 21 22 23 |
# File 'lib/twitter_cldr/localized/localized_array.rb', line 20 def sort! TwitterCldr::Collation::Collator.new(locale).sort!(base_obj) self end |
#to_a ⇒ Object
29 30 31 |
# File 'lib/twitter_cldr/localized/localized_array.rb', line 29 def to_a @base_obj.dup end |
#to_sentence ⇒ Object
33 34 35 |
# File 'lib/twitter_cldr/localized/localized_array.rb', line 33 def to_sentence TwitterCldr::Formatters::ListFormatter.new(locale).format(base_obj) end |
#to_yaml(options = {}) ⇒ Object
45 46 47 |
# File 'lib/twitter_cldr/localized/localized_array.rb', line 45 def to_yaml( = {}) TwitterCldr::Utils::YAML.dump(@base_obj, ) end |