Class: TripIt::RailSegment

Inherits:
Base
  • Object
show all
Defined in:
lib/trip_it/classes/segments/rail_segment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#Boolean, #camelize, #chkAndPopulate, #chkObjAndPopulate, #convertDT, #to_hash, #to_json, #to_xml

Methods included from ParamUtil

#address_param, #airportcode_param, #array_param, #boolean_param, #boolean_read_param, #camelize, #date_param, #datetime_param, #exceptions, #float_param, #integer_param, #string_param, #time_param, #traveler_array_param, #traveler_param

Constructor Details

#initialize(params = {}) ⇒ RailSegment

Returns a new instance of RailSegment.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/trip_it/classes/segments/rail_segment.rb', line 8

def initialize(params = {})
  @start_date_time        = convertDT(params["StartDateTime"])
  @end_date_time          = convertDT(params["EndDateTime"])
  @start_station_address  = TripIt::Address.new(params["StartStationAddress"]) unless params["StartStationAddress"].nil?
  @end_station_address    = TripIt::Address.new(params["EndStationAddress"]) unless params["EndStationAddress"].nil?
  @id                     = params["id"]
  @start_station_name     = params["start_station_name"]
  @end_station_name       = params["end_station_name"]
  @carrier_name           = params["carrier_name"]
  @coach_number           = params["coach_number"]
  @confirmation_num       = params["confirmation_num"]
  @seats                  = params["seats"]
  @service_class          = params["service_class"]
  @train_number           = params["train_number"]
  @train_type             = params["train_type"]
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/trip_it/classes/segments/rail_segment.rb', line 6

def id
  @id
end