Class: StationMaster::Station
- Inherits:
-
Object
- Object
- StationMaster::Station
- Extended by:
- Find
- Defined in:
- lib/station_master/station.rb,
lib/station_master/station/find.rb
Defined Under Namespace
Modules: Find
Instance Attribute Summary collapse
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#region_id ⇒ Object
readonly
Returns the value of attribute region_id.
-
#station_code ⇒ Object
readonly
Returns the value of attribute station_code.
Instance Method Summary collapse
-
#initialize(station_code, latitude, longitude, region_id, location) ⇒ Station
constructor
A new instance of Station.
- #to_hash ⇒ Object
Methods included from Find
all, find_by_city, find_details, find_region_id_by_code
Constructor Details
#initialize(station_code, latitude, longitude, region_id, location) ⇒ Station
Returns a new instance of Station.
9 10 11 12 13 14 15 |
# File 'lib/station_master/station.rb', line 9 def initialize(station_code, latitude, longitude, region_id, location) @station_code = station_code @latitude = latitude @longitude = longitude @region_id = region_id @location = location end |
Instance Attribute Details
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
7 8 9 |
# File 'lib/station_master/station.rb', line 7 def latitude @latitude end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
7 8 9 |
# File 'lib/station_master/station.rb', line 7 def location @location end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
7 8 9 |
# File 'lib/station_master/station.rb', line 7 def longitude @longitude end |
#region_id ⇒ Object (readonly)
Returns the value of attribute region_id.
7 8 9 |
# File 'lib/station_master/station.rb', line 7 def region_id @region_id end |
#station_code ⇒ Object (readonly)
Returns the value of attribute station_code.
7 8 9 |
# File 'lib/station_master/station.rb', line 7 def station_code @station_code end |
Instance Method Details
#to_hash ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/station_master/station.rb', line 17 def to_hash { station_code: station_code, latitude: latitude, longitude: longitude, region_id: region_id, location: location } end |