Class: Point

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y) ⇒ Point

Returns a new instance of Point.



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

def initialize(x, y)
  @x, @y = x, y
end

Instance Attribute Details

#xObject (readonly)

Returns the value of attribute x.



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

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



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

def y
  @y
end