Sha256: f60465715d431844e0f0991ffe230db0aeb0460702f6ade70a73dd3b57598fd0

Contents?: true

Size: 655 Bytes

Versions: 31

Compression:

Stored size: 655 Bytes

Contents

# frozen_string_literal: true

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

31 entries across 31 versions & 1 rubygems

Version Path
torque-postgresql-3.4.1 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-2.4.5 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-3.4.0 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-3.3.3 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-2.4.4 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-3.3.2 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-2.4.3 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-3.3.1 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-3.3.0 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-3.2.2 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-2.4.2 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-2.4.1 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-3.2.1 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-2.4.0 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-3.2.0 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-3.1.0 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-2.3.0 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-3.0.1 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-2.2.4 lib/torque/postgresql/adapter/oid/box.rb
torque-postgresql-3.0.0 lib/torque/postgresql/adapter/oid/box.rb