Sha256: 89bd10205243695dc54dd81cd964b096d84f2fd42060a5096f4412029b1e5d08

Contents?: true

Size: 301 Bytes

Versions: 12

Compression:

Stored size: 301 Bytes

Contents

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

12 entries across 12 versions & 1 rubygems

Version Path
rom-sql-3.1.0 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-3.0.1 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-3.0.0 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-2.5.0 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-2.4.0 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-2.3.0 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-2.2.1 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-2.2.0 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-2.1.0 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-2.0.0 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-2.0.0.rc1 lib/rom/sql/extensions/postgres/types/network.rb
rom-sql-2.0.0.beta3 lib/rom/sql/extensions/postgres/types/network.rb