Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/markov_chain_chat_bot.rb
Overview
:enddoc:
Instance Method Summary collapse
-
#append_limited(appendment, limit) ⇒ Object
appends
appendmentto this String or throws:out_of_limitif this String will exceedlimitafter the appending.
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 |