Method: WSDSL#route_loading_point

Defined in:
lib/wsdsl.rb

#route_loading_pointInteger

Assign a route loading point to compare two routes. Using this point value, one can load routes with the more globbing routes later than short routes.

Returns:

  • (Integer)

    point value

Since:

  • 0.0.3



337
338
339
340
341
342
343
344
345
346
347
# File 'lib/wsdsl.rb', line 337

def route_loading_point
  url =~ /(.*?):(.*?)[\/\.](.*)/
  return url.size if $1.nil?
  # The shortest the prepend, the further the service should be loaded
  prepend = $1.size
  # The shortest the placeholder, the further it should be in the queue
  place_holder = $2.size
   # The shortest the trail, the further it should be in the queue
  trail = $3.size
  prepend + place_holder + trail
end