Class: TwitterCldr::Localized::LocalizedArray

Inherits:
LocalizedObject show all
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

Methods inherited from LocalizedObject

#initialize, localize

Constructor Details

This class inherits a constructor from TwitterCldr::Localized::LocalizedObject

Instance Method Details

#code_points_to_stringObject



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

#eachObject



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_constObject



25
26
27
# File 'lib/twitter_cldr/localized/localized_array.rb', line 25

def formatter_const
  nil
end

#sortObject



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_aObject



29
30
31
# File 'lib/twitter_cldr/localized/localized_array.rb', line 29

def to_a
  @base_obj.dup
end

#to_sentenceObject



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(options = {})
  TwitterCldr::Utils::YAML.dump(@base_obj, options)
end