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
3 4 5 |
# File 'lib/torque/postgresql/adapter/oid/circle.rb', line 3 def r @r end |
#x ⇒ Object
Returns the value of attribute x
3 4 5 |
# File 'lib/torque/postgresql/adapter/oid/circle.rb', line 3 def x @x end |
#y ⇒ Object
Returns the value of attribute y
3 4 5 |
# File 'lib/torque/postgresql/adapter/oid/circle.rb', line 3 def y @y end |
Instance Method Details
#center ⇒ Object
7 8 9 |
# File 'lib/torque/postgresql/adapter/oid/circle.rb', line 7 def center point_class.new(x, y) end |
#center=(value) ⇒ Object
11 12 13 14 15 |
# File 'lib/torque/postgresql/adapter/oid/circle.rb', line 11 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 |