class SqlPostgres::PgLineSegment
This class holds the value of a “line segment” column.
Public Class Methods
from_sql(s)
click to toggle source
Create a PgLineSegment
from a string in Postgres format
# File lib/sqlpostgres/PgLineSegment.rb, line 13 def from_sql(s) if s =~ /^\[(\(.*\)),(\(.*\))\]$/ PgLineSegment.new(PgPoint.from_sql($1), PgPoint.from_sql($2)) else raise ArgumentError, "Invalid lseg: #{s.inspect}" end end
Private Instance Methods
column_type()
click to toggle source
# File lib/sqlpostgres/PgLineSegment.rb, line 25 def column_type 'lseg' end