class ChunkyText::Chunker
Constants
- PREPEND_COUNT
Attributes
chunk_array[R]
elipse[R]
get_chunk[R]
max_length[R]
string[RW]
Public Class Methods
new(string, max_length, elipse = "(...)")
click to toggle source
# File lib/ChunkyText/chunker.rb, line 9 def initialize(string, max_length, elipse = "(...)") @string = string @elipse = elipse @max_length = max_length - elipse.length - 1 end
Private Instance Methods
last_space(string)
click to toggle source
# File lib/ChunkyText/chunker.rb, line 47 def last_space(string) position = string.rindex /\s/ end