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/markov_chain_chat_bot.rb, line 79 def append_limited(appendment, limit) throw :out_of_limit if self.length + appendment.length > limit self << appendment return self end