Module: WordWrap

Defined in:
lib/word_wrap/wrapper.rb,
lib/word_wrap.rb,
lib/word_wrap/version.rb

Overview

The actual implementation of wrapping TODO: share code between wrap and fit implementations

Defined Under Namespace

Classes: Wrapper

Constant Summary collapse

DEFAULT_WIDTH =
80
VERSION =
"0.2.0"

Class Method Summary collapse

Class Method Details

.ww(text, width = DEFAULT_WIDTH, fit = false) ⇒ Object



10
11
12
13
# File 'lib/word_wrap.rb', line 10

def self.ww(text, width=DEFAULT_WIDTH, fit=false)
  w = Wrapper.new(text, width)
  fit ? w.fit : w.wrap
end