Class: TextWrapper
- Inherits:
-
Object
- Object
- TextWrapper
- Defined in:
- lib/textwrap.rb
Constant Summary collapse
- @@kwargs =
[ :width, :expand_tabs, :replace_whitespace, :initial_indent, :subsequent_indent, :break_long_words, :consider_linebreak_whitespace, :code ]
Instance Method Summary collapse
- #fill(text, width = nil, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ TextWrapper
constructor
A new instance of TextWrapper.
- #wrap(text, width = nil, options = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ TextWrapper
Returns a new instance of TextWrapper.
136 137 138 139 140 141 |
# File 'lib/textwrap.rb', line 136 def initialize( = {}) @@kwargs.each do |kw| next unless .has_key?(kw) self.instance_variable_set("@#{kw}", [kw]) end end |