diff options
Diffstat (limited to 'dragon/string.rb')
| -rw-r--r-- | dragon/string.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/dragon/string.rb b/dragon/string.rb index 8d2d9ba..5fa273c 100644 --- a/dragon/string.rb +++ b/dragon/string.rb @@ -38,6 +38,7 @@ S self[0..-2] end + # @gtk def wrapped_lines length self.each_line.map do |l| l = l.rstrip @@ -50,20 +51,22 @@ S end.flatten end + # @gtk def wrap length wrapped_lines(length).join.rstrip end + # @gtk def multiline? include? "\n" end - def indent_lines amount + def indent_lines amount, char = " " self.each_line.each_with_index.map do |l, i| if i == 0 l else - " " * amount + l + char * amount + l end end.join end |
