class TranslateLogic

Class for managing cure tr (translate).

Attributes

in[W]

Public Class Methods

new() click to toggle source
Calls superclass method BaseLogic::new
# File lib/cureutils/logic/translate_logic.rb, line 9
def initialize
  super
  @translate_from = :human_name
  @translate_to = :precure_name
end

Public Instance Methods

pregex2str(str) click to toggle source
# File lib/cureutils/logic/translate_logic.rb, line 26
def pregex2str(str)
  str.gsub(/\[:(.*):\]/, '\1')
end
print_results() click to toggle source
str2pregex(str) click to toggle source
# File lib/cureutils/logic/translate_logic.rb, line 22
def str2pregex(str)
  '[:' + str + ':]'
end
translate_from_to(from, to) click to toggle source
# File lib/cureutils/logic/translate_logic.rb, line 17
def translate_from_to(from, to)
  @translate_from = pregex2str(from).to_sym
  @translate_to = pregex2str(to).to_sym
end