Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/ebps/conversion/oebps.rb

Direct Known Subclasses

EBPS::Text::Picture

Constant Summary collapse

UMLAUT_SUB =
{
  'Ä' => 'ae',
  'ä' => 'ae',
  'Ö' => 'oe',
  'ö' => 'oe',
  'Ü' => 'ue',
  'ü' => 'ue',
}

Instance Method Summary collapse

Instance Method Details

#sortableObject



21
22
23
24
25
# File 'lib/ebps/conversion/oebps.rb', line 21

def sortable
  dupl = dup
  dupl.sortable!
  dupl
end

#sortable!Object



26
27
28
29
30
31
32
33
# File 'lib/ebps/conversion/oebps.rb', line 26

def sortable!
  res = downcase!
  UMLAUT_SUB.each do |ptrn, repl|
    tmp = gsub! Regexp.new(ptrn, 'U'), repl
    res ||= tmp
  end
  res
end

#to_xsObject

overwrite Builder’s to_xs



35
36
37
# File 'lib/ebps/conversion/oebps.rb', line 35

def to_xs
  gsub('&', '&amp;').gsub('<', '&lt;').gsub('>', '&gt;')
end