Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/markov_chain_chat_bot.rb

Overview

:enddoc:

Instance Method Summary collapse

Instance Method Details

#append_limited(appendment, limit) ⇒ Object

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

It returns this (modified) String.



79
80
81
82
83
# 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