Class: SocialFramework::RouteHelper::RouteContext

Inherits:
Object
  • Object
show all
Defined in:
app/helpers/social_framework/route_helper.rb

Overview

Used to define the RouteStrategy class

Instance Method Summary collapse

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