Class: Cldr::Data::Delimiters

Inherits:
Base
  • Object
show all
Defined in:
lib/cldr/data/delimiters.rb

Instance Attribute Summary

Attributes inherited from Base

#locale

Instance Method Summary collapse

Methods inherited from Base

#[]=, #update

Methods inherited from Hash

#deep_merge, #deep_stringify_keys, #symbolize_keys

Constructor Details

#initialize(locale) ⇒ Delimiters

Returns a new instance of Delimiters.



4
5
6
7
8
# File 'lib/cldr/data/delimiters.rb', line 4

def initialize(locale)
  super
  self[:'delimiters.quotes.default']   = quotes('quotation')
  self[:'delimiters.quotes.alternate'] = quotes('alternateQuotation')
end

Instance Method Details

#quotes(type) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/cldr/data/delimiters.rb', line 10

def quotes(type)
  start = select("delimiters/#{type}Start").first
  end_  = select("delimiters/#{type}End").first

  result = {}
  result[:start] = start.content if start
  result[:end]   = end_.content  if end_
  result
end