Class: SmartyStreets::URLPrefixSender

Inherits:
Object
  • Object
show all
Defined in:
lib/smartystreets_ruby_sdk/url_prefix_sender.rb

Instance Method Summary collapse

Constructor Details

#initialize(url_prefix, inner) ⇒ URLPrefixSender

Returns a new instance of URLPrefixSender.



3
4
5
6
# File 'lib/smartystreets_ruby_sdk/url_prefix_sender.rb', line 3

def initialize(url_prefix, inner)
  @url_prefix = url_prefix
  @inner = inner
end

Instance Method Details

#send(request) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/smartystreets_ruby_sdk/url_prefix_sender.rb', line 8

def send(request)
  if request.url_components.nil?
    request.url_prefix = @url_prefix
  else
    request.url_prefix = @url_prefix + request.url_components
  end

  @inner.send(request)
end