Class: AlfaInsurance::BusSegment

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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_atObject (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_stationObject (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_atObject (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_stationObject (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

#numberObject (readonly)

Returns the value of attribute number.



3
4
5
# File 'lib/alfa_insurance/insurance.rb', line 3

def number
  @number
end

#place_numberObject (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_numberObject (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_dateObject



25
26
27
# File 'lib/alfa_insurance/insurance.rb', line 25

def arrival_date
  arrival_at && arrival_at.to_date.iso8601
end

#arrival_timeObject



29
30
31
# File 'lib/alfa_insurance/insurance.rb', line 29

def arrival_time
  arrival_at && arrival_at.strftime("%H:%M:%S")
end

#departure_dateObject



17
18
19
# File 'lib/alfa_insurance/insurance.rb', line 17

def departure_date
  departure_at && departure_at.to_date.iso8601
end

#departure_timeObject



21
22
23
# File 'lib/alfa_insurance/insurance.rb', line 21

def departure_time
  departure_at && departure_at.strftime("%H:%M:%S")
end