Class: Cldr::Export::Data::Delimiters

Inherits:
Base
  • Object
show all
Defined in:
lib/cldr/export/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.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/cldr/export/data/delimiters.rb', line 5

def initialize(locale)
  super
  update(
    :delimiters => {
      :quotes => {
        :default   => quotes('quotation'),
        :alternate => quotes('alternateQuotation')
      }
    }
  )
end

Instance Method Details

#quotes(type) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/cldr/export/data/delimiters.rb', line 17

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