Class: Polygon::Point
- Inherits:
-
Object
- Object
- Polygon::Point
- Defined in:
- lib/polygon/point.rb
Overview
A polygon point to represent a point inside a canvas or to build a shape
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Point
constructor
A new instance of Point.
Constructor Details
#initialize(attributes = {}) ⇒ Point
Returns a new instance of Point.
8 9 10 11 12 13 |
# File 'lib/polygon/point.rb', line 8 def initialize(attributes = {}) attributes.each do |key, value| setter = "#{key}=" send(setter, value) if respond_to?(setter) end end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
6 7 8 |
# File 'lib/polygon/point.rb', line 6 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
6 7 8 |
# File 'lib/polygon/point.rb', line 6 def y @y end |