Sha256: a1dea78334f9182ce1d7e6dae57ac01c8073a514464b0be16e4d979847398434

Contents?: true

Size: 567 Bytes

Versions: 7

Compression:

Stored size: 567 Bytes

Contents

class Upsert
  # @private
  class Connection
    attr_reader :controller
    attr_reader :metal

    def initialize(controller, metal)
      @controller = controller
      @metal = metal
    end

    def convert_binary(bind_values)
      bind_values.map do |v|
        case v
        when Upsert::Binary
          binary v
        else
          v
        end
      end
    end

    def bind_value(v)
      case v
      when Time, DateTime
        Upsert.utc_iso8601 v
      when Date
        v.strftime ISO8601_DATE
      else
        v
      end
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
upsert-1.1.7 lib/upsert/connection.rb
upsert-1.1.6 lib/upsert/connection.rb
upsert-1.1.5 lib/upsert/connection.rb
upsert-1.1.4 lib/upsert/connection.rb
upsert-1.1.3 lib/upsert/connection.rb
upsert-1.1.1 lib/upsert/connection.rb
upsert-1.1.0 lib/upsert/connection.rb