Sha256: db2b710baa0f137e313bb87a6923c11ab9cf46991c5cadde406f1c5f7a4d7514

Contents?: true

Size: 332 Bytes

Versions: 8

Compression:

Stored size: 332 Bytes

Contents

# frozen_string_literal: true

require 'ipaddr'

module ROM
  module SQL
    module Postgres
      module Types
        IPAddress = Type('inet') do
          read = SQL::Types.Constructor(IPAddr) { |ip| IPAddr.new(ip.to_s) }

          SQL::Types.Constructor(IPAddr, &:to_s).meta(read: read)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rom-sql-3.6.0 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-3.5.0 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-3.4.0 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-3.3.3 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-3.3.2 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-3.3.1 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-3.3.0 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-3.2.0 lib/rom/sql/extensions/postgres/types/network.rb