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