def add_row(row)
      raise('Cannot add a row. No parameters have been set.') if rows.empty?

      # A quick 'deep clone' so that the input isn't modified
      row = Marshal::load(Marshal.dump(row))

      case
        when row.is_a?(Array)
          # 'stringify' input
          row.collect! { |value| value.to_s }

          @rows << Row.new("|#{row.join('|')}|")
        when row.is_a?(Hash)
          # 'stringify' input
          row = row.inject({}) { |hash, (key, value)| hash[key.to_s] = value.to_s; hash }

          @rows << Row.new("|#{ordered_row_values(row).join('|')}|")
        else
          raise(ArgumentError, "Can only add row from a Hash or an Array but received #{row.class}")
      end
    end
def add_row(row)
      raise('Cannot add a row. No parameters have been set.') if rows.empty?

      # A quick 'deep clone' so that the input isn't modified
      row = Marshal::load(Marshal.dump(row))

      case
        when row.is_a?(Array)
          # 'stringify' input
          row.collect! { |value| value.to_s }

          @rows << Row.new("|#{row.join('|')}|")
        when row.is_a?(Hash)
          # 'stringify' input
          row = row.inject({}) { |hash, (key, value)| hash[key.to_s] = value.to_s; hash }

          @rows << Row.new("|#{ordered_row_values(row).join('|')}|")
        else
          raise(ArgumentError, "Can only add row from a Hash or an Array but received #{row.class}")
      end
    end
Creates a new Example object and, if *source_text* is provided,
 populates the object.
 Adds a row to the example table. The row can be given as a Hash of
 parameters and their corresponding values or as an Array of values which
 will be assigned in order.