Class: SocialFramework::RouteHelper::RouteContext
- Inherits:
-
Object
- Object
- SocialFramework::RouteHelper::RouteContext
- Defined in:
- app/helpers/social_framework/route_helper.rb
Overview
Used to define the RouteStrategy class
Instance Method Summary collapse
-
#compare_routes(principal_route, secondary_route) ⇒ Object
- Compare the routes to verify if are compatible ====== Params:
principal_route
Route
who gives a liftsecondary_route
-
Route
who hitchhike Returns Hash with information of compatibility and necessary distances.
- Compare the routes to verify if are compatible ====== Params:
-
#initialize(route_strategy = RouteStrategyDefault) ⇒ RouteContext
constructor
Initialize the RouteStrategy class.
Constructor Details
#initialize(route_strategy = RouteStrategyDefault) ⇒ RouteContext
Initialize the RouteStrategy class
318 319 320 |
# File 'app/helpers/social_framework/route_helper.rb', line 318 def initialize route_strategy = RouteStrategyDefault @route = route_strategy.new end |
Instance Method Details
#compare_routes(principal_route, secondary_route) ⇒ Object
Compare the routes to verify if are compatible
Params:
principal_route
-
Route
who gives a lift secondary_route
-
Route
who hitchhike
Returns Hash with information of compatibility and necessary distances
327 328 329 |
# File 'app/helpers/social_framework/route_helper.rb', line 327 def compare_routes(principal_route, secondary_route) @route.compare_routes(principal_route, secondary_route) end |