Class: VoiceML::ScopedTransport Private

Inherits:
Object
  • Object
show all
Defined in:
lib/voiceml/transport.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A transport view pinned to a specific product base URL.

Wraps a real Transport and forwards every call, injecting a base_url override so an entire resource group lands on its product subdomain (conversations.voicetel.com / messaging.voicetel.com) without each resource needing to know its own host.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(inner, base_url) ⇒ ScopedTransport

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ScopedTransport.



319
320
321
322
# File 'lib/voiceml/transport.rb', line 319

def initialize(inner, base_url)
  @inner    = inner
  @base_url = Transport.strip_trailing_slashes(base_url)
end

Instance Attribute Details

#base_urlObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



317
318
319
# File 'lib/voiceml/transport.rb', line 317

def base_url
  @base_url
end

Instance Method Details

#account_sidObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



324
325
326
# File 'lib/voiceml/transport.rb', line 324

def 
  @inner.
end

#fetch_bytes(path) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



332
333
334
# File 'lib/voiceml/transport.rb', line 332

def fetch_bytes(path)
  @inner.fetch_bytes(path, base_url: @base_url)
end

#request(method, path, params: nil, form: nil, json: nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



328
329
330
# File 'lib/voiceml/transport.rb', line 328

def request(method, path, params: nil, form: nil, json: nil)
  @inner.request(method, path, params: params, form: form, json: json, base_url: @base_url)
end