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