Class: ActiveRecord::ConnectionAdapters::RawGeomInfo
- Inherits:
-
Struct
- Object
- Struct
- ActiveRecord::ConnectionAdapters::RawGeomInfo
- Defined in:
- lib/postgis_adapter.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#dimension ⇒ Object
Returns the value of attribute dimension.
-
#srid ⇒ Object
Returns the value of attribute srid.
-
#type ⇒ Object
Returns the value of attribute type.
-
#with_m ⇒ Object
Returns the value of attribute with_m.
-
#with_z ⇒ Object
Returns the value of attribute with_z.
Instance Method Summary collapse
Instance Attribute Details
#dimension ⇒ Object
Returns the value of attribute dimension
323 324 325 |
# File 'lib/postgis_adapter.rb', line 323 def dimension @dimension end |
#srid ⇒ Object
Returns the value of attribute srid
323 324 325 |
# File 'lib/postgis_adapter.rb', line 323 def srid @srid end |
#type ⇒ Object
Returns the value of attribute type
323 324 325 |
# File 'lib/postgis_adapter.rb', line 323 def type @type end |
#with_m ⇒ Object
Returns the value of attribute with_m
323 324 325 |
# File 'lib/postgis_adapter.rb', line 323 def with_m @with_m end |
#with_z ⇒ Object
Returns the value of attribute with_z
323 324 325 |
# File 'lib/postgis_adapter.rb', line 323 def with_z @with_z end |
Instance Method Details
#convert! ⇒ Object
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 |
# File 'lib/postgis_adapter.rb', line 324 def convert! self.type = "geometry" if self.type.nil? #if geometry the geometrytype constraint is not present : need to set the type here then if dimension == 4 self.with_m = true self.with_z = true elsif dimension == 3 if with_m self.with_z = false self.with_m = true else self.with_z = true self.with_m = false end else self.with_z = false self.with_m = false end end |