def apply_rule(cell_number, grid, study)
      @cell_number = cell_number
      @grid = grid
      case study.method
      when :random then apply_rule_with_random_method
      when :single then apply_rule_with_single_method
      end
    end
def apply_rule(cell_number, grid, study)
      @cell_number = cell_number
      @grid = grid
      case study.method
      when :random then apply_rule_with_random_method
      when :single then apply_rule_with_single_method
      end
    end
Public: Apply the rule on a single cell.

 cell_number - Integer number of the cell to apply the rule on.
 grid        - The entire grid as an Array of Integer.
 study       - Study instance.

 Returns the Integer new state of the cell for the next generation.