Class: ApiValve::Forwarder::LocationConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/api_valve/forwarder/location_converter.rb

Instance Method Summary collapse

Constructor Details

#initialize(location, options) ⇒ LocationConverter

Returns a new instance of LocationConverter.



3
4
5
6
# File 'lib/api_valve/forwarder/location_converter.rb', line 3

def initialize(location, options)
  @location = location
  @options = options
end

Instance Method Details

#callObject



8
9
10
11
12
13
14
# File 'lib/api_valve/forwarder/location_converter.rb', line 8

def call
  if other_host? || same_prefix?
    @location.to_s
  else
    convert_location
  end
end