class String

Public Instance Methods

append_limited(appendment, limit) click to toggle source

appends appendment to this String or throws :out_of_limit if this String will exceed limit after the appending.

It returns this (modified) String.

# File lib/lib/markov_chain_chat_bot.rb, line 78
def append_limited(appendment, limit)
  throw :out_of_limit if self.length + appendment.length > limit
  self << appendment
  return self
end