Class: CycleHire::Station
- Inherits:
-
Object
- Object
- CycleHire::Station
- Defined in:
- lib/cycle_hire/station.rb
Instance Attribute Summary collapse
-
#area ⇒ Object
readonly
Returns the value of attribute area.
-
#bikes ⇒ Object
readonly
Returns the value of attribute bikes.
-
#empty_docks ⇒ Object
readonly
Returns the value of attribute empty_docks.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#installed ⇒ Object
readonly
Returns the value of attribute installed.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#locked ⇒ Object
readonly
Returns the value of attribute locked.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#temporary ⇒ Object
readonly
Returns the value of attribute temporary.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(name, id = nil, latitude = nil, longitude = nil, bikes = nil, empty_docks = nil, installed = nil, locked = nil, temporary = nil, timestamp = nil) ⇒ Station
constructor
A new instance of Station.
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, id = nil, latitude = nil, longitude = nil, bikes = nil, empty_docks = nil, installed = nil, locked = nil, temporary = nil, timestamp = nil) ⇒ Station
Returns a new instance of Station.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/cycle_hire/station.rb', line 4 def initialize(name, id = nil, latitude = nil, longitude = nil, bikes = nil, empty_docks = nil, installed = nil, locked = nil, temporary = nil, = nil) parse_name!(name) @id = id @latitude = latitude @longitude = longitude @bikes = bikes @empty_docks = empty_docks @installed = installed @locked = locked @temporary = temporary @timestamp = end |
Instance Attribute Details
#area ⇒ Object (readonly)
Returns the value of attribute area.
2 3 4 |
# File 'lib/cycle_hire/station.rb', line 2 def area @area end |
#bikes ⇒ Object (readonly)
Returns the value of attribute bikes.
2 3 4 |
# File 'lib/cycle_hire/station.rb', line 2 def bikes @bikes end |
#empty_docks ⇒ Object (readonly)
Returns the value of attribute empty_docks.
2 3 4 |
# File 'lib/cycle_hire/station.rb', line 2 def empty_docks @empty_docks end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
2 3 4 |
# File 'lib/cycle_hire/station.rb', line 2 def id @id end |
#installed ⇒ Object (readonly)
Returns the value of attribute installed.
2 3 4 |
# File 'lib/cycle_hire/station.rb', line 2 def installed @installed end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
2 3 4 |
# File 'lib/cycle_hire/station.rb', line 2 def latitude @latitude end |
#locked ⇒ Object (readonly)
Returns the value of attribute locked.
2 3 4 |
# File 'lib/cycle_hire/station.rb', line 2 def locked @locked end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
2 3 4 |
# File 'lib/cycle_hire/station.rb', line 2 def longitude @longitude end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/cycle_hire/station.rb', line 2 def name @name end |
#temporary ⇒ Object (readonly)
Returns the value of attribute temporary.
2 3 4 |
# File 'lib/cycle_hire/station.rb', line 2 def temporary @temporary end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
2 3 4 |
# File 'lib/cycle_hire/station.rb', line 2 def @timestamp end |
Instance Method Details
#to_h ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/cycle_hire/station.rb', line 19 def to_h { :id => @id, :name => @name, :area => @area, :latitude => @latitude, :longitude => @longitude, :bikes => @bikes, :empty_docks => @empty_docks, :installed => @installed, :locked => @locked, :temporary => @temporary, :timestamp => @timestamp } end |
#to_s ⇒ Object
35 36 37 |
# File 'lib/cycle_hire/station.rb', line 35 def to_s @name + ', ' + @area end |