class Slacken::Rendering::StringWrapper
Internal: A string which may adjoin previous and next strings.
Public Class Methods
new(str)
click to toggle source
# File lib/slacken/rendering.rb, line 26 def initialize(str) @str = str end
wrap(str)
click to toggle source
# File lib/slacken/rendering.rb, line 22 def self.wrap(str) str.kind_of?(StringWrapper) ? str : new(str) end
Public Instance Methods
append(other)
click to toggle source
Internal: Append another string to self.
# File lib/slacken/rendering.rb, line 35 def append(other) other.concat_head(self) end
concat_head(other)
click to toggle source
Internal: prepend another string to self.
# File lib/slacken/rendering.rb, line 40 def concat_head(other) StringWrapper.new(other.to_s + to_s) end
to_s()
click to toggle source
# File lib/slacken/rendering.rb, line 30 def to_s @str.to_s end