Class: Transport::Location

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(location) ⇒ Location

Returns a new instance of Location.



11
12
13
14
15
16
17
18
# File 'lib/location.rb', line 11

def initialize(location)
  @id = location['id']
  @type = location['type']
  @name = location['name']
  @score = location['score']
  @coordinate = Coordinate.new location['coordinate']
  @distance = location['distance']
end

Instance Attribute Details

#coordinateObject (readonly)

Returns the value of attribute coordinate.



9
10
11
# File 'lib/location.rb', line 9

def coordinate
  @coordinate
end

#distanceObject (readonly)

Returns the value of attribute distance.



9
10
11
# File 'lib/location.rb', line 9

def distance
  @distance
end

#idObject (readonly)

Returns the value of attribute id.



9
10
11
# File 'lib/location.rb', line 9

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/location.rb', line 9

def name
  @name
end

#scoreObject (readonly)

Returns the value of attribute score.



9
10
11
# File 'lib/location.rb', line 9

def score
  @score
end

#typeObject (readonly)

Returns the value of attribute type.



9
10
11
# File 'lib/location.rb', line 9

def type
  @type
end