class SqlPostgres::PgBox

This class holds the value of a “point” column.

Public Class Methods

from_sql(s) click to toggle source

Create a PgBox from a string in Postgres format

# File lib/sqlpostgres/PgBox.rb, line 13
def from_sql(s)
  if s =~ /^(\(.*\)),(\(.*\))$/
    PgBox.new(PgPoint.from_sql($1), PgPoint.from_sql($2))
  else
    raise ArgumentError, "Invalid box: #{s.inspect}"
  end
end

Private Instance Methods

column_type() click to toggle source
# File lib/sqlpostgres/PgBox.rb, line 25
def column_type
  'box'
end