Class: SpreeCmCommissioner::Integrations::BookMeBusV1::Resources::Direction
- Inherits:
-
Base
- Object
- Base
- SpreeCmCommissioner::Integrations::BookMeBusV1::Resources::Direction
- Defined in:
- app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/direction.rb
Instance Attribute Summary collapse
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#id ⇒ Object
Returns the value of attribute id.
-
#long_name ⇒ Object
Returns the value of attribute long_name.
-
#operator_id ⇒ Object
Returns the value of attribute operator_id.
-
#operator_name ⇒ Object
Returns the value of attribute operator_name.
-
#origin ⇒ Object
Returns the value of attribute origin.
-
#route_type ⇒ Object
Returns the value of attribute route_type.
-
#short_name ⇒ Object
Returns the value of attribute short_name.
-
#stops ⇒ Object
Returns the value of attribute stops.
Instance Method Summary collapse
- #destination_location_id ⇒ Object
- #destination_name ⇒ Object
-
#initialize(attributes = {}) ⇒ Direction
constructor
A new instance of Direction.
- #origin_location_id ⇒ Object
- #origin_name ⇒ Object
- #to_h ⇒ Object
Methods inherited from Base
from_json_api, from_json_api_item, from_json_api_single
Constructor Details
#initialize(attributes = {}) ⇒ Direction
Returns a new instance of Direction.
13 14 15 16 17 18 19 |
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/direction.rb', line 13 def initialize(attributes = {}) super(attributes) @origin = attributes['origin'] || {} @destination = attributes['destination'] || {} @stops = attributes['stops'] || [] end |
Instance Attribute Details
#destination ⇒ Object
Returns the value of attribute destination.
3 4 5 |
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/direction.rb', line 3 def destination @destination end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/direction.rb', line 3 def id @id end |
#long_name ⇒ Object
Returns the value of attribute long_name.
3 4 5 |
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/direction.rb', line 3 def long_name @long_name end |
#operator_id ⇒ Object
Returns the value of attribute operator_id.
3 4 5 |
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/direction.rb', line 3 def operator_id @operator_id end |
#operator_name ⇒ Object
Returns the value of attribute operator_name.
3 4 5 |
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/direction.rb', line 3 def operator_name @operator_name end |
#origin ⇒ Object
Returns the value of attribute origin.
3 4 5 |
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/direction.rb', line 3 def origin @origin end |
#route_type ⇒ Object
Returns the value of attribute route_type.
3 4 5 |
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/direction.rb', line 3 def route_type @route_type end |
#short_name ⇒ Object
Returns the value of attribute short_name.
3 4 5 |
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/direction.rb', line 3 def short_name @short_name end |
#stops ⇒ Object
Returns the value of attribute stops.
3 4 5 |
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/direction.rb', line 3 def stops @stops end |
Instance Method Details
#destination_location_id ⇒ Object
25 26 27 |
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/direction.rb', line 25 def destination_location_id @destination['location_id'] end |
#destination_name ⇒ Object
33 34 35 |
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/direction.rb', line 33 def destination_name @destination['location_name'] end |
#origin_location_id ⇒ Object
21 22 23 |
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/direction.rb', line 21 def origin_location_id @origin['location_id'] end |
#origin_name ⇒ Object
29 30 31 |
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/direction.rb', line 29 def origin_name @origin['location_name'] end |
#to_h ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/direction.rb', line 37 def to_h { id: id, short_name: short_name, long_name: long_name, route_type: route_type, origin: origin, destination: destination, stops: stops, operator_id: operator_id, operator_name: operator_name }.compact end |