lib/two_chainz/words_table.rb
def increment(first_word=nil, second_word=nil)
    # Don't do anything if we didn't get a first or second word
    return 0 unless first_word || second_word

    # Only one of these will run, since we error if both are nil
    first_word  ||= :beginning
    second_word ||= :ending

    add_row(first_word)
    add_row(second_word) unless second_word == :ending

    row(first_word)[second_word]  += 1
  end
# Public: Increment the value in the table for the specified pair of words.
#
# first_word  - The word that comes first in the pair. If this is nil, the
#               second word in the pair will be recorded as the beginning of
#               a sentence.
# second_word - The word that comes last in the pair. If this is nil or
#               omitted, the first word in the pair will be recorded as the
#               ending of a sentence.
#
# Returns the new count of the entry.
Increment the value in the table for the specified pair of words.
first_word  - The word that comes first in the pair. If this is nil, the
second word in the pair will be recorded as the beginning of
a sentence.
second_word - The word that comes last in the pair. If this is nil or
omitted, the first word in the pair will be recorded as the
ending of a sentence.

Returns the new count of the entry.
Increment the value in the table for the specified pair of words . first_word - The word that comes first in the pair . If this is nil the second word in the pair will be recorded as the beginning of a sentence . second_word - The word that comes last in the pair . If this is nil or omitted the first word in the pair will be recorded as the ending of a sentence . Returns the new count of the entry .
def increment(first_word=nil, second_word=nil)
    return 0 unless first_word || second_word
    first_word  ||= :beginning
    second_word ||= :ending
    add_row(first_word)
    add_row(second_word) unless second_word == :ending
    row(first_word)[second_word]  += 1
  end
def increment ( first_word = nil , second_word = nil ) return 0 unless first_word || second_word first_word ||= :beginning second_word ||= :ending add_row ( first_word ) add_row ( second_word ) unless second_word == :ending row ( first_word ) [ second_word ] += 1 end
Public: Increment the value in the table for the specified pair of words.
Public : Increment the value in the table for the specified pair of words .
# Don't do anything if we didn't get a first or second word # Only one of these will run, since we error if both are nil
first_word
second_word