Class: Transport::Coordinate

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(coordinate) ⇒ Coordinate

Returns a new instance of Coordinate.



9
10
11
12
13
# File 'lib/coordinate.rb', line 9

def initialize(coordinate)
  @type = coordinate['type'].to_sym
  @x = coordinate['x']
  @y = coordinate['y']
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/coordinate.rb', line 7

def type
  @type
end

#xObject (readonly)

Returns the value of attribute x.



7
8
9
# File 'lib/coordinate.rb', line 7

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



7
8
9
# File 'lib/coordinate.rb', line 7

def y
  @y
end