Class: SpreeCmCommissioner::TripQueryResult

Inherits:
Object
  • Object
show all
Defined in:
lib/spree_cm_commissioner/trip_query_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(trips, connection_id: nil) ⇒ TripQueryResult

Returns a new instance of TripQueryResult.



5
6
7
8
# File 'lib/spree_cm_commissioner/trip_query_result.rb', line 5

def initialize(trips, connection_id: nil)
  @trips = Array(trips)
  @connection_id = connection_id
end

Instance Attribute Details

#connection_idObject (readonly)

Returns the value of attribute connection_id.



3
4
5
# File 'lib/spree_cm_commissioner/trip_query_result.rb', line 3

def connection_id
  @connection_id
end

#tripsObject (readonly)

Returns the value of attribute trips.



3
4
5
# File 'lib/spree_cm_commissioner/trip_query_result.rb', line 3

def trips
  @trips
end

Instance Method Details

#direct?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/spree_cm_commissioner/trip_query_result.rb', line 10

def direct?
  @trips.size == 1
end