Class: Twilio::REST::Domain
- Inherits:
-
Object
- Object
- Twilio::REST::Domain
- Defined in:
- lib/twilio-ruby/framework/rest/domain.rb
Direct Known Subclasses
AccountsBase, ApiBase, AssistantsBase, BulkexportsBase, ChatBase, ContentBase, ConversationsBase, EventsBase, FlexApiBase, FrontlineApiBase, IamBase, InsightsBase, IntelligenceBase, IpMessagingBase, LookupsBase, MarketplaceBase, MessagingBase, MicrovisorBase, MonitorBase, NotifyBase, NumbersBase, OauthBase, PreviewBase, PreviewIamBase, PricingBase, ProxyBase, RoutesBase, ServerlessBase, StudioBase, SupersimBase, SyncBase, TaskrouterBase, TrunkingBase, TrusthubBase, VerifyBase, VideoBase, VoiceBase, WirelessBase
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #absolute_url(uri) ⇒ Object
-
#initialize(client) ⇒ Domain
constructor
A new instance of Domain.
- #request(method, uri, params = {}, data = {}, headers = {}, auth = nil, timeout = nil) ⇒ Object
Constructor Details
#initialize(client) ⇒ Domain
Returns a new instance of Domain.
8 9 10 11 12 13 |
# File 'lib/twilio-ruby/framework/rest/domain.rb', line 8 def initialize(client) @client = client @host = nil @base_url = nil @port = nil end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
6 7 8 |
# File 'lib/twilio-ruby/framework/rest/domain.rb', line 6 def client @client end |
Instance Method Details
#absolute_url(uri) ⇒ Object
15 16 17 |
# File 'lib/twilio-ruby/framework/rest/domain.rb', line 15 def absolute_url(uri) "#{@base_url.chomp('/')}/#{uri.chomp('/').gsub(/^\//, '')}" end |
#request(method, uri, params = {}, data = {}, headers = {}, auth = nil, timeout = nil) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/twilio-ruby/framework/rest/domain.rb', line 19 def request(method, uri, params = {}, data = {}, headers = {}, auth = nil, timeout = nil) url = uri.match(/^http/) ? uri : absolute_url(uri) @client.request( @base_url, @port, method, url, params, data, headers, auth, timeout ) end |