Class: Torque::PostgreSQL::Circle
- Inherits:
-
Struct
- Object
- Struct
- Torque::PostgreSQL::Circle
- Defined in:
- lib/torque/postgresql/adapter/oid/circle.rb
Instance Attribute Summary collapse
-
#r ⇒ Object
(also: #radius)
Returns the value of attribute r.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
Instance Attribute Details
#r ⇒ Object Also known as: radius
Returns the value of attribute r
5 6 7 |
# File 'lib/torque/postgresql/adapter/oid/circle.rb', line 5 def r @r end |
#x ⇒ Object
Returns the value of attribute x
5 6 7 |
# File 'lib/torque/postgresql/adapter/oid/circle.rb', line 5 def x @x end |
#y ⇒ Object
Returns the value of attribute y
5 6 7 |
# File 'lib/torque/postgresql/adapter/oid/circle.rb', line 5 def y @y end |
Instance Method Details
#center ⇒ Object
9 10 11 |
# File 'lib/torque/postgresql/adapter/oid/circle.rb', line 9 def center point_class.new(x, y) end |
#center=(value) ⇒ Object
13 14 15 16 17 |
# File 'lib/torque/postgresql/adapter/oid/circle.rb', line 13 def center=(value) parts = value.is_a?(point_class) ? [value.x, value.y] : value[0..1] self.x = parts.first self.y = parts.last end |