module String::Builder

Public Instance Methods

[](*objs) click to toggle source
# File lib/string/builder.rb, line 4
def [](*objs) objs.map(&:to_s)*self.new end
build(*objs) { |builder = self| ... } click to toggle source
# File lib/string/builder.rb, line 6
def build(*objs)
  content = self.[](*objs)
  return content unless block_given?
  yield builder = self.new
  content << builder
end
build!(*objs) { |builder = string| ... } click to toggle source
# File lib/string/builder.rb, line 26
def build!(*objs)
  content = String[*objs]
  return self << content unless block_given?
  yield builder = String.new
  self << content << builder
end
respond_to?(id, private = false) click to toggle source
Calls superclass method
# File lib/string/builder.rb, line 13
def respond_to?(id, private = false)
  %i[[] build].include?(id.to_sym) ? true : super
end