Class: TextConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/record/text_converter.rb

Constant Summary collapse

@@ESCAPE_SEQUENCE_START =
0x1b.chr
@@ESCAPE_SEQUENCE_END =
0x6d.chr

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.ESCAPE_SEQUENCE_ENDObject



10
11
12
# File 'lib/record/text_converter.rb', line 10

def self.ESCAPE_SEQUENCE_END
	@@ESCAPE_SEQUENCE_END
end

.ESCAPE_SEQUENCE_STARTObject



6
7
8
# File 'lib/record/text_converter.rb', line 6

def self.ESCAPE_SEQUENCE_START
	@@ESCAPE_SEQUENCE_START
end

Instance Method Details

#remove_escape_sequences(text) ⇒ Object



14
15
16
17
# File 'lib/record/text_converter.rb', line 14

def remove_escape_sequences text
	if text.nil? then return nil end
	text.gsub(/#{@@ESCAPE_SEQUENCE_START}.*?#{@@ESCAPE_SEQUENCE_END}/, '')
end