Class: SpreeCmCommissioner::Integrations::BookMeBusV1::Resources::ReservationCart::Reservation

Inherits:
Base
  • Object
show all
Defined in:
app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

from_json_api, from_json_api_item, from_json_api_single, #initialize

Constructor Details

This class inherits a constructor from SpreeCmCommissioner::Integrations::BookMeBusV1::Resources::Base

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def amount
  @amount
end

#contact_emailObject

Returns the value of attribute contact_email.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def contact_email
  @contact_email
end

#contact_nameObject

Returns the value of attribute contact_name.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def contact_name
  @contact_name
end

#contact_phoneObject

Returns the value of attribute contact_phone.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def contact_phone
  @contact_phone
end

#currency_codeObject

Returns the value of attribute currency_code.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def currency_code
  @currency_code
end

#departure_dateObject

Returns the value of attribute departure_date.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def departure_date
  @departure_date
end

#departure_timeObject

Returns the value of attribute departure_time.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def departure_time
  @departure_time
end

#fareObject

Returns the value of attribute fare.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def fare
  @fare
end

#from_locationObject

Returns the value of attribute from_location.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def from_location
  @from_location
end

#idObject

Returns the value of attribute id.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def id
  @id
end

#number_of_seatsObject

Returns the value of attribute number_of_seats.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def number_of_seats
  @number_of_seats
end

#reservation_numberObject

Returns the value of attribute reservation_number.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def reservation_number
  @reservation_number
end

#reservation_qr_code_urlObject

Returns the value of attribute reservation_qr_code_url.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def reservation_qr_code_url
  @reservation_qr_code_url
end

#reserved_seatsObject

Returns the value of attribute reserved_seats.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def reserved_seats
  @reserved_seats
end

#route_typeObject

Returns the value of attribute route_type.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def route_type
  @route_type
end

#statusObject

Returns the value of attribute status.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def status
  @status
end

#to_locationObject

Returns the value of attribute to_location.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def to_location
  @to_location
end

#trip_fare_typeObject

Returns the value of attribute trip_fare_type.



46
47
48
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 46

def trip_fare_type
  @trip_fare_type
end

Instance Method Details

#to_hObject



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb', line 65

def to_h
  {
    'id' => id,
    'status' => status,
    'reservation_number' => reservation_number,
    'fare' => fare,
    'amount' => amount,
    'currency_code' => currency_code,
    'number_of_seats' => number_of_seats,
    'departure_date' => departure_date,
    'contact_name' => contact_name,
    'contact_phone' => contact_phone,
    'contact_email' => contact_email,
    'reserved_seats' => reserved_seats,
    'reservation_qr_code_url' => reservation_qr_code_url,
    'departure_time' => departure_time
  }.compact
end