Class: AlfaInsurance::BusSegment
- Inherits:
-
Object
- Object
- AlfaInsurance::BusSegment
- Defined in:
- lib/alfa_insurance/insurance.rb
Instance Attribute Summary collapse
-
#arrival_at ⇒ Object
readonly
Returns the value of attribute arrival_at.
-
#arrival_station ⇒ Object
readonly
Returns the value of attribute arrival_station.
-
#departure_at ⇒ Object
readonly
Returns the value of attribute departure_at.
-
#departure_station ⇒ Object
readonly
Returns the value of attribute departure_station.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#place_number ⇒ Object
readonly
Returns the value of attribute place_number.
-
#route_number ⇒ Object
readonly
Returns the value of attribute route_number.
Instance Method Summary collapse
- #arrival_date ⇒ Object
- #arrival_time ⇒ Object
- #departure_date ⇒ Object
- #departure_time ⇒ Object
-
#initialize(params = {}) ⇒ BusSegment
constructor
A new instance of BusSegment.
Constructor Details
#initialize(params = {}) ⇒ BusSegment
Returns a new instance of BusSegment.
11 12 13 14 15 |
# File 'lib/alfa_insurance/insurance.rb', line 11 def initialize(params = {}) params.each do |attr, value| instance_variable_set("@#{attr}", value) end end |
Instance Attribute Details
#arrival_at ⇒ Object (readonly)
Returns the value of attribute arrival_at.
3 4 5 |
# File 'lib/alfa_insurance/insurance.rb', line 3 def arrival_at @arrival_at end |
#arrival_station ⇒ Object (readonly)
Returns the value of attribute arrival_station.
3 4 5 |
# File 'lib/alfa_insurance/insurance.rb', line 3 def arrival_station @arrival_station end |
#departure_at ⇒ Object (readonly)
Returns the value of attribute departure_at.
3 4 5 |
# File 'lib/alfa_insurance/insurance.rb', line 3 def departure_at @departure_at end |
#departure_station ⇒ Object (readonly)
Returns the value of attribute departure_station.
3 4 5 |
# File 'lib/alfa_insurance/insurance.rb', line 3 def departure_station @departure_station end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
3 4 5 |
# File 'lib/alfa_insurance/insurance.rb', line 3 def number @number end |
#place_number ⇒ Object (readonly)
Returns the value of attribute place_number.
3 4 5 |
# File 'lib/alfa_insurance/insurance.rb', line 3 def place_number @place_number end |
#route_number ⇒ Object (readonly)
Returns the value of attribute route_number.
3 4 5 |
# File 'lib/alfa_insurance/insurance.rb', line 3 def route_number @route_number end |
Instance Method Details
#arrival_date ⇒ Object
25 26 27 |
# File 'lib/alfa_insurance/insurance.rb', line 25 def arrival_date arrival_at && arrival_at.to_date.iso8601 end |
#arrival_time ⇒ Object
29 30 31 |
# File 'lib/alfa_insurance/insurance.rb', line 29 def arrival_time arrival_at && arrival_at.strftime("%H:%M:%S") end |
#departure_date ⇒ Object
17 18 19 |
# File 'lib/alfa_insurance/insurance.rb', line 17 def departure_date departure_at && departure_at.to_date.iso8601 end |
#departure_time ⇒ Object
21 22 23 |
# File 'lib/alfa_insurance/insurance.rb', line 21 def departure_time departure_at && departure_at.strftime("%H:%M:%S") end |