Class: SqlPostgres::PgBox
- Inherits:
-
PgTwoPoints
- Object
- PgType
- PgTwoPoints
- SqlPostgres::PgBox
- Defined in:
- lib/sqlpostgres/PgBox.rb
Overview
This class holds the value of a “point” column.
Instance Attribute Summary
Attributes inherited from PgTwoPoints
Class Method Summary collapse
-
.from_sql(s) ⇒ Object
Create a PgBox from a string in Postgres format.
Methods inherited from PgTwoPoints
Methods inherited from PgType
Constructor Details
This class inherits a constructor from SqlPostgres::PgTwoPoints
Class Method Details
.from_sql(s) ⇒ Object
Create a PgBox from a string in Postgres format
13 14 15 16 17 18 19 |
# 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 |