Class: Graphit::Point

Inherits:
Object
  • Object
show all
Defined in:
lib/graphit/point.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y) ⇒ Point

Returns a new instance of Point.



6
7
8
9
# File 'lib/graphit/point.rb', line 6

def initialize( x, y )
  self.x = x.to_f
  self.y = y.to_f
end

Instance Attribute Details

#xObject

Returns the value of attribute x.



3
4
5
# File 'lib/graphit/point.rb', line 3

def x
  @x
end

#yObject

Returns the value of attribute y.



4
5
6
# File 'lib/graphit/point.rb', line 4

def y
  @y
end