Sha256: a80d5b646a41b80ab7ed87e1290515e4b8c87c1f68cd9c0a183a5bd346630976

Contents?: true

Size: 624 Bytes

Versions: 15

Compression:

Stored size: 624 Bytes

Contents

module Torque
  module PostgreSQL
    class Box < Struct.new(:x1, :y1, :x2, :y2)
      def points
        klass = Torque::PostgreSQL.config.geometry.point_class
        [
          klass.new(x1, y1),
          klass.new(x1, y2),
          klass.new(x2, y1),
          klass.new(x2, y2),
        ]
      end
    end

    config.geometry.box_class ||= ::ActiveRecord.const_set('Box', Class.new(Box))

    module Adapter
      module OID
        class Box < Torque::PostgreSQL::GeometryBuilder

          PIECES = %i[x1 y1 x2 y2].freeze
          FORMATION = '((%s,%s),(%s,%s))'.freeze

        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
torque-postgresql-1.1.8 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-1.1.7 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-2.0.3 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-2.0.2 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-1.1.6 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-1.1.5 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-2.0.1 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-2.0.0 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-1.1.4 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-1.1.3 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-1.1.2 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-1.1.1 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-1.1.0 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-1.0.1 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-1.0.0 lib/torque/postgresql/adapter/oid/box.rb