Class: Escort::Formatter::StringSplitter

Inherits:
Object
  • Object
show all
Defined in:
lib/escort/formatter/string_splitter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_segment_width, options = {}) ⇒ StringSplitter


6
7
8
9
# File 'lib/escort/formatter/string_splitter.rb', line 6

def initialize(max_segment_width, options = {})
  @max_segment_width = max_segment_width
  #@first_segment_max_length = options[:first_segment_max_length] || max_segment_width
end

Instance Attribute Details

#max_segment_widthObject (readonly)

, :first_segment_max_length


4
5
6
# File 'lib/escort/formatter/string_splitter.rb', line 4

def max_segment_width
  @max_segment_width
end

Instance Method Details

#split(input_string) ⇒ Object


11
12
13
14
15
16
17
18
# File 'lib/escort/formatter/string_splitter.rb', line 11

def split(input_string)
  input_strings = input_string.split("\n")
  [split_strings(input_strings)].flatten
  #first_string = strings.shift
  #other_strings = strings
  #result = [split_first_string(first_string) + split_strings(other_strings)].flatten
  #result
end