class Ting::Converter
Attributes
from_conv[R]
from_tone[R]
to_conv[R]
to_tone[R]
Public Class Methods
new(from, from_tone, to, to_tone)
click to toggle source
# File lib/ting/converter.rb, line 7 def initialize(from, from_tone, to, to_tone) @from_conv, @from_tone, @to_conv, @to_tone = from, from_tone, to, to_tone end
Public Instance Methods
convert(str)
click to toggle source
# File lib/ting/converter.rb, line 19 def convert(str) writer.unparse reader.parse(str) end
reader()
click to toggle source
# File lib/ting/converter.rb, line 11 def reader @reader ||= Reader.new(from_conv, from_tone) end
to(to, to_tone)
click to toggle source
# File lib/ting/converter.rb, line 23 def to(to, to_tone) Converter.new(self.from_conv, self.from_tone, to, to_tone) end
writer()
click to toggle source
# File lib/ting/converter.rb, line 15 def writer @writer ||= Writer.new(to_conv, to_tone) end