Class: Service::Client::BoundRoute

Inherits:
Object
  • Object
show all
Defined in:
lib/service-client/bound_route.rb

Instance Method Summary collapse

Constructor Details

#initialize(route, args) ⇒ BoundRoute

Returns a new instance of BoundRoute.



2
3
4
5
# File 'lib/service-client/bound_route.rb', line 2

def initialize(route, args)
  @route = route
  @args = args || []
end

Instance Method Details

#url_for_method(method) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/service-client/bound_route.rb', line 7

def url_for_method(method)
  pattern = @route.pattern_for(method)

  raise Service::Client::RoutingError.new("Method #{method} unsupported!") unless pattern

  pattern.filled_with(options_for_pattern(pattern))
end