twilio-ruby 3.9.0 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
 
3
- gemspec
3
+ gemspec
@@ -3,8 +3,8 @@ module Twilio
3
3
  class Accounts < ListResource; end
4
4
 
5
5
  class Account < InstanceResource
6
- def initialize(uri, client, params={})
7
- super uri, client, params
6
+ def initialize(path, client, params={})
7
+ super path, client, params
8
8
  resource :sandbox, :available_phone_numbers, :incoming_phone_numbers,
9
9
  :calls, :outgoing_caller_ids, :conferences, :sms, :recordings,
10
10
  :transcriptions, :notifications, :applications, :connect_apps,
@@ -1,8 +1,8 @@
1
1
  module Twilio
2
2
  module REST
3
3
  class AvailablePhoneNumbers < ListResource
4
- def initialize(uri, client)
5
- @uri, @client = uri, client
4
+ def initialize(path, client)
5
+ @path, @client = path, client
6
6
  @instance_class = Twilio::REST::Country
7
7
  @list_key, @instance_id_key = 'countries', 'country_code'
8
8
  end
@@ -1,8 +1,8 @@
1
1
  module Twilio
2
2
  module REST
3
3
  class Country < InstanceResource
4
- def initialize(uri, client, params={})
5
- super uri, client, params
4
+ def initialize(path, client, params={})
5
+ super path, client, params
6
6
  resource :local, :toll_free
7
7
  end
8
8
  end
@@ -1,8 +1,8 @@
1
1
  module Twilio
2
2
  module REST
3
3
  class Local < ListResource
4
- def initialize(uri, client)
5
- @uri, @client = uri, client
4
+ def initialize(path, client)
5
+ @path, @client = path, client
6
6
  @instance_class = Twilio::REST::AvailablePhoneNumber
7
7
  @list_key, @instance_id_key = 'available_phone_numbers', 'sid'
8
8
  end
@@ -1,8 +1,8 @@
1
1
  module Twilio
2
2
  module REST
3
3
  class TollFree < ListResource
4
- def initialize(uri, client)
5
- @uri, @client = uri, client
4
+ def initialize(path, client)
5
+ @path, @client = path, client
6
6
  @instance_class = Twilio::REST::AvailablePhoneNumber
7
7
  @list_key, @instance_id_key = 'available_phone_numbers', 'sid'
8
8
  end
@@ -7,8 +7,8 @@ module Twilio
7
7
  end
8
8
 
9
9
  class Call < InstanceResource
10
- def initialize(uri, client, params={})
11
- super uri, client, params
10
+ def initialize(path, client, params={})
11
+ super path, client, params
12
12
  resource :recordings, :notifications
13
13
  end
14
14
 
@@ -153,13 +153,13 @@ module Twilio
153
153
  # obtained from parsing the JSON object in the response body.
154
154
  [:get, :put, :post, :delete].each do |method|
155
155
  method_class = Net::HTTP.const_get method.to_s.capitalize
156
- define_method method do |uri, *args|
156
+ define_method method do |path, *args|
157
157
  params = twilify args[0]; params = {} if params.empty?
158
- unless args[1]
159
- uri = "#{uri}.json" # create a local copy of the uri to manipulate
160
- uri << "?#{url_encode(params)}" if method == :get && !params.empty?
158
+ unless args[1] # build the full path unless already given
159
+ path = "#{path}.json"
160
+ path << "?#{url_encode(params)}" if method == :get && !params.empty?
161
161
  end
162
- request = method_class.new uri, HTTP_HEADERS
162
+ request = method_class.new path, HTTP_HEADERS
163
163
  request.basic_auth @account_sid, @auth_token
164
164
  request.form_data = params if [:post, :put].include? method
165
165
  connect_and_send request
@@ -3,8 +3,8 @@ module Twilio
3
3
  class Conferences < ListResource; end
4
4
 
5
5
  class Conference < InstanceResource
6
- def initialize(uri, client, params={})
7
- super uri, client, params
6
+ def initialize(path, client, params={})
7
+ super path, client, params
8
8
  resource :participants
9
9
  end
10
10
  end
@@ -1,7 +1,7 @@
1
1
  module Twilio
2
2
  module REST
3
3
  class Participants < ListResource
4
- def initialize(uri, client)
4
+ def initialize(path, client)
5
5
  super
6
6
  # hard-code the json key since participants don't have sids
7
7
  @instance_id_key = 'call_sid'
@@ -10,25 +10,25 @@ module Twilio
10
10
  include Utils
11
11
 
12
12
  ##
13
- # Instantiate a new instance resource object. You must pass the +uri+ of
13
+ # Instantiate a new instance resource object. You must pass the +path+ of
14
14
  # the instance (e.g. /2010-04-01/Accounts/AC123/Calls/CA456) as well as a
15
15
  # +client+ object that responds to #get #post and #delete. This client
16
16
  # is meant to be an instance of Twilio::REST::Client but could just as
17
17
  # well be a mock object if you want to test the interface. The optional
18
18
  # +params+ hash will be converted into attributes on the instantiated
19
19
  # object.
20
- def initialize(uri, client, params = {})
21
- @uri, @client = uri, client
20
+ def initialize(path, client, params = {})
21
+ @path, @client = path, client
22
22
  set_up_properties_from params
23
23
  end
24
24
 
25
25
  def inspect # :nodoc:
26
- "<#{self.class} @uri=#{@uri}>"
26
+ "<#{self.class} @path=#{@path}>"
27
27
  end
28
28
 
29
29
  ##
30
30
  # Update the properties of this instance resource using the key/value
31
- # pairs in +params+. This makes an HTTP POST request to <tt>@uri</tt>
31
+ # pairs in +params+. This makes an HTTP POST request to <tt>@path</tt>
32
32
  # to handle the update. For example, to update the +VoiceUrl+ of a Twilio
33
33
  # Application you could write:
34
34
  #
@@ -38,27 +38,27 @@ module Twilio
38
38
  # instance resource, including the newly updated properties.
39
39
  def update(params = {})
40
40
  raise "Can't update a resource without a REST Client" unless @client
41
- set_up_properties_from(@client.post(@uri, params))
41
+ set_up_properties_from(@client.post(@path, params))
42
42
  self
43
43
  end
44
44
 
45
45
  ##
46
46
  # Refresh the attributes of this instance resource object by fetching it
47
- # from Twilio. Calling this makes an HTTP GET request to <tt>@uri</tt>.
47
+ # from Twilio. Calling this makes an HTTP GET request to <tt>@path</tt>.
48
48
  def refresh
49
49
  raise "Can't refresh a resource without a REST Client" unless @client
50
50
  @updated = false
51
- set_up_properties_from(@client.get(@uri))
51
+ set_up_properties_from(@client.get(@path))
52
52
  self
53
53
  end
54
54
 
55
55
  ##
56
56
  # Delete an instance resource from Twilio. This operation isn't always
57
57
  # supported. For instance, you can't delete an SMS. Calling this method
58
- # makes an HTTP DELETE request to <tt>@uri</tt>.
58
+ # makes an HTTP DELETE request to <tt>@path</tt>.
59
59
  def delete
60
60
  raise "Can't delete a resource without a REST Client" unless @client
61
- @client.delete @uri
61
+ @client.delete @path
62
62
  end
63
63
 
64
64
  ##
@@ -66,7 +66,7 @@ module Twilio
66
66
  # until an attempt is made to access an unknown attribute.
67
67
  def method_missing(method, *args)
68
68
  super if @updated
69
- set_up_properties_from(@client.get(@uri))
69
+ set_up_properties_from(@client.get(@path))
70
70
  self.send method, *args
71
71
  end
72
72
 
@@ -76,7 +76,7 @@ module Twilio
76
76
  eigenclass = class << self; self; end
77
77
  hash.each do |p,v|
78
78
  property = detwilify p
79
- unless ['uri', 'client', 'updated'].include? property
79
+ unless ['client', 'updated'].include? property
80
80
  eigenclass.send :define_method, property.to_sym, &lambda {v}
81
81
  end
82
82
  end
@@ -86,10 +86,10 @@ module Twilio
86
86
  def resource(*resources)
87
87
  resources.each do |r|
88
88
  resource = twilify r
89
- relative_uri = r == :sms ? 'SMS' : resource
90
- uri = "#{@uri}/#{relative_uri}"
89
+ relative_path = r == :sms ? 'SMS' : resource
90
+ path = "#{@path}/#{relative_path}"
91
91
  resource_class = Twilio::REST.const_get resource
92
- instance_variable_set("@#{r}", resource_class.new(uri, @client))
92
+ instance_variable_set("@#{r}", resource_class.new(path, @client))
93
93
  end
94
94
  self.class.instance_eval {attr_reader *resources}
95
95
  end
@@ -3,15 +3,15 @@ module Twilio
3
3
  class ListResource
4
4
  include Utils
5
5
 
6
- def initialize(uri, client)
7
- @uri, @client = uri, client
6
+ def initialize(path, client)
7
+ @path, @client = path, client
8
8
  resource_name = self.class.name.split('::')[-1]
9
9
  @instance_class = Twilio::REST.const_get resource_name.chop
10
10
  @list_key, @instance_id_key = detwilify(resource_name), 'sid'
11
11
  end
12
12
 
13
13
  def inspect # :nodoc:
14
- "<#{self.class} @uri=#{@uri}>"
14
+ "<#{self.class} @path=#{@path}>"
15
15
  end
16
16
 
17
17
  ##
@@ -24,13 +24,13 @@ module Twilio
24
24
  #
25
25
  # The optional +params+ hash allows you to filter the list returned. The
26
26
  # filters for each list resource type are defined by Twilio.
27
- def list(params={}, full_uri=false)
27
+ def list(params={}, full_path=false)
28
28
  raise "Can't get a resource list without a REST Client" unless @client
29
- response = @client.get @uri, params, full_uri
29
+ response = @client.get @path, params, full_path
30
30
  resources = response[@list_key]
31
- uri = full_uri ? @uri.split('.')[0] : @uri
31
+ path = full_path ? @path.split('.')[0] : @path
32
32
  resource_list = resources.map do |resource|
33
- @instance_class.new "#{uri}/#{resource[@instance_id_key]}", @client,
33
+ @instance_class.new "#{path}/#{resource[@instance_id_key]}", @client,
34
34
  resource
35
35
  end
36
36
  # set the +total+ and +next_page+ properties on the array
@@ -51,24 +51,24 @@ module Twilio
51
51
 
52
52
  ##
53
53
  # Ask Twilio for the total number of items in the list.
54
- # Calling this method makes an HTTP GET request to <tt>@uri</tt> with a
54
+ # Calling this method makes an HTTP GET request to <tt>@path</tt> with a
55
55
  # page size parameter of 1 to minimize data over the wire while still
56
56
  # obtaining the total. Don't use this if you are planning to
57
57
  # call #list anyway, since the array returned from #list will have a
58
58
  # +total+ attribute as well.
59
59
  def total
60
60
  raise "Can't get a resource total without a REST Client" unless @client
61
- @client.get(@uri, :page_size => 1)['total']
61
+ @client.get(@path, :page_size => 1)['total']
62
62
  end
63
63
 
64
64
  ##
65
- # Return an empty instance resource object with the proper URI. Note that
65
+ # Return an empty instance resource object with the proper path. Note that
66
66
  # this will never raise a Twilio::REST::RequestError on 404 since no HTTP
67
67
  # request is made. The HTTP request is made when attempting to access an
68
68
  # attribute of the returned instance resource object, such as
69
69
  # its #date_created or #voice_url attributes.
70
70
  def get(sid)
71
- @instance_class.new "#{@uri}/#{sid}", @client
71
+ @instance_class.new "#{@path}/#{sid}", @client
72
72
  end
73
73
  alias :find :get # for the ActiveRecord lovers
74
74
 
@@ -76,11 +76,11 @@ module Twilio
76
76
  # Return a newly created resource. Some +params+ may be required. Consult
77
77
  # the Twilio REST API documentation related to the kind of resource you
78
78
  # are attempting to create for details. Calling this method makes an HTTP
79
- # POST request to <tt>@uri</tt> with the given params
79
+ # POST request to <tt>@path</tt> with the given params
80
80
  def create(params={})
81
81
  raise "Can't create a resource without a REST Client" unless @client
82
- response = @client.post @uri, params
83
- @instance_class.new "#{@uri}/#{response[@instance_id_key]}", @client,
82
+ response = @client.post @path, params
83
+ @instance_class.new "#{@path}/#{response[@instance_id_key]}", @client,
84
84
  response
85
85
  end
86
86
  end
@@ -3,8 +3,8 @@ module Twilio
3
3
  class Queues < ListResource; end
4
4
 
5
5
  class Queue < InstanceResource
6
- def initialize(uri, client, params={})
7
- super uri, client, params
6
+ def initialize(path, client, params={})
7
+ super path, client, params
8
8
  resource :members
9
9
  end
10
10
  end
@@ -1,14 +1,14 @@
1
1
  module Twilio
2
2
  module REST
3
3
  class Members < ListResource
4
- def initialize(uri, client)
4
+ def initialize(path, client)
5
5
  super
6
6
  # hard-code the json keys since members are special
7
7
  @list_key, @instance_id_key = 'queue_members', 'call_sid'
8
8
  end
9
9
 
10
10
  def front
11
- @instance_class.new "#{@uri}/Front", @client
11
+ @instance_class.new "#{@path}/Front", @client
12
12
  end
13
13
 
14
14
  def front!
@@ -3,9 +3,9 @@ module Twilio
3
3
  class Recordings < ListResource; end
4
4
 
5
5
  class Recording < InstanceResource
6
- def initialize(uri, client, params={})
7
- uri.sub! /\/Calls\/CA[^\/]+/, ''
8
- super uri, client, params
6
+ def initialize(path, client, params={})
7
+ path.sub! /\/Calls\/CA[^\/]+/, ''
8
+ super path, client, params
9
9
  resource :transcriptions
10
10
  # grab a reference to the client's connection object for streaming
11
11
  @connection = @client.instance_variable_get :@connection
@@ -14,21 +14,21 @@ module Twilio
14
14
  ##
15
15
  # Return the wav URL for this recording.
16
16
  def wav
17
- "https://#{@connection.address}#{@uri}.wav"
17
+ "https://#{@connection.address}#{@path}.wav"
18
18
  end
19
19
 
20
20
  def wav!(&block)
21
- @connection.request_get @uri, &block
21
+ @connection.request_get @path, &block
22
22
  end
23
23
 
24
24
  ##
25
25
  # Return the mp3 URL for this recording.
26
26
  def mp3
27
- "https://#{@connection.address}#{@uri}.mp3"
27
+ "https://#{@connection.address}#{@path}.mp3"
28
28
  end
29
29
 
30
30
  def mp3!(&block)
31
- @connection.request_get "#{@uri}.mp3", &block
31
+ @connection.request_get "#{@path}.mp3", &block
32
32
  end
33
33
  end
34
34
  end
@@ -1,8 +1,8 @@
1
1
  module Twilio
2
2
  module REST
3
3
  class Sms < InstanceResource
4
- def initialize(uri, client, params={})
5
- super uri, client, params
4
+ def initialize(path, client, params={})
5
+ super path, client, params
6
6
  resource :messages, :short_codes
7
7
  end
8
8
  end
@@ -1,7 +1,7 @@
1
1
  module Twilio
2
2
  module REST
3
3
  class Messages < ListResource
4
- def initialize(uri, client)
4
+ def initialize(path, client)
5
5
  super
6
6
  # hard-code the json key since 'messages' doesn't exist in the response
7
7
  @list_key = 'sms_messages'
@@ -1,7 +1,7 @@
1
1
  module Twilio
2
2
  module REST
3
3
  class Usage < InstanceResource
4
- def initialize(uri, client, params={})
4
+ def initialize(path, client, params={})
5
5
  super
6
6
  resource :records, :triggers
7
7
  end
@@ -5,14 +5,14 @@ module Twilio
5
5
  SUBRESOURCES = [:daily, :monthly, :yearly, :all_time, :today, :yesterday,
6
6
  :this_month, :last_month]
7
7
 
8
- def initialize(uri, client)
8
+ def initialize(path, client)
9
9
  super
10
10
  @list_key = 'usage_records'
11
11
  end
12
12
 
13
13
  def method_missing(method, *args)
14
14
  super unless SUBRESOURCES.include? method
15
- self.class.new "#{@uri}/#{twilify(method)}", @client
15
+ self.class.new "#{@path}/#{twilify(method)}", @client
16
16
  end
17
17
  end
18
18
 
@@ -1,7 +1,7 @@
1
1
  module Twilio
2
2
  module REST
3
3
  class Triggers < ListResource
4
- def initialize(uri, client)
4
+ def initialize(path, client)
5
5
  super
6
6
  @list_key = 'usage_triggers'
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '3.9.0'
2
+ VERSION = '3.10.0'
3
3
  end
@@ -1,63 +1,58 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Twilio::REST::Account do
4
- it 'should set up an incoming phone numbers resources object' do
5
- account = Twilio::REST::Account.new('someUri', 'someClient')
6
- account.respond_to?(:incoming_phone_numbers).should == true
7
- account.incoming_phone_numbers.instance_variable_get('@uri').should == 'someUri/IncomingPhoneNumbers'
4
+
5
+ before do
6
+ @account = Twilio::REST::Account.new('someUri', 'someClient')
7
+ end
8
+
9
+ it 'sets up incoming phone numbers resources object' do
10
+ @account.should respond_to(:incoming_phone_numbers)
11
+ @account.incoming_phone_numbers.instance_variable_get('@path').should == 'someUri/IncomingPhoneNumbers'
8
12
  end
9
13
 
10
- it 'should set up an available phone numbers resources object' do
11
- account = Twilio::REST::Account.new('someUri', 'someClient')
12
- account.respond_to?(:available_phone_numbers).should == true
13
- account.available_phone_numbers.instance_variable_get('@uri').should == 'someUri/AvailablePhoneNumbers'
14
+ it 'sets up an available phone numbers resources object' do
15
+ @account.should respond_to(:available_phone_numbers)
16
+ @account.available_phone_numbers.instance_variable_get('@path').should == 'someUri/AvailablePhoneNumbers'
14
17
  end
15
18
 
16
- it 'should set up an outgoing caller ids resources object' do
17
- account = Twilio::REST::Account.new('someUri', 'someClient')
18
- account.respond_to?(:outgoing_caller_ids).should == true
19
- account.outgoing_caller_ids.instance_variable_get('@uri').should == 'someUri/OutgoingCallerIds'
19
+ it 'sets up an outgoing caller ids resources object' do
20
+ @account.should respond_to(:outgoing_caller_ids)
21
+ @account.outgoing_caller_ids.instance_variable_get('@path').should == 'someUri/OutgoingCallerIds'
20
22
  end
21
23
 
22
- it 'should set up a calls resources object' do
23
- account = Twilio::REST::Account.new('someUri', 'someClient')
24
- account.respond_to?(:calls).should == true
25
- account.calls.instance_variable_get('@uri').should == 'someUri/Calls'
24
+ it 'sets up a calls resources object' do
25
+ @account.should respond_to(:calls)
26
+ @account.calls.instance_variable_get('@path').should == 'someUri/Calls'
26
27
  end
27
28
 
28
- it 'should set up a conferences resources object' do
29
- account = Twilio::REST::Account.new('someUri', 'someClient')
30
- account.respond_to?(:conferences).should == true
31
- account.conferences.instance_variable_get('@uri').should == 'someUri/Conferences'
29
+ it 'sets up a conferences resources object' do
30
+ @account.should respond_to(:conferences)
31
+ @account.conferences.instance_variable_get('@path').should == 'someUri/Conferences'
32
32
  end
33
33
 
34
- it 'should set up a queues resources object' do
35
- account = Twilio::REST::Account.new('someUri', 'someClient')
36
- account.respond_to?(:queues).should == true
37
- account.queues.instance_variable_get('@uri').should == 'someUri/Queues'
34
+ it 'sets up a queues resources object' do
35
+ @account.should respond_to(:queues)
36
+ @account.queues.instance_variable_get('@path').should == 'someUri/Queues'
38
37
  end
39
38
 
40
- it 'should set up a sms resource object' do
41
- account = Twilio::REST::Account.new('someUri', 'someClient')
42
- account.respond_to?(:sms).should == true
43
- account.sms.instance_variable_get('@uri').should == 'someUri/SMS'
39
+ it 'sets up a sms resource object' do
40
+ @account.should respond_to(:sms)
41
+ @account.sms.instance_variable_get('@path').should == 'someUri/SMS'
44
42
  end
45
43
 
46
- it 'should set up a recordings resources object' do
47
- account = Twilio::REST::Account.new('someUri', 'someClient')
48
- account.respond_to?(:recordings).should == true
49
- account.recordings.instance_variable_get('@uri').should == 'someUri/Recordings'
44
+ it 'sets up a recordings resources object' do
45
+ @account.should respond_to(:recordings)
46
+ @account.recordings.instance_variable_get('@path').should == 'someUri/Recordings'
50
47
  end
51
48
 
52
- it 'should set up a transcriptions resources object' do
53
- account = Twilio::REST::Account.new('someUri', 'someClient')
54
- account.respond_to?(:transcriptions).should == true
55
- account.transcriptions.instance_variable_get('@uri').should == 'someUri/Transcriptions'
49
+ it 'sets up a transcriptions resources object' do
50
+ @account.should respond_to(:transcriptions)
51
+ @account.transcriptions.instance_variable_get('@path').should == 'someUri/Transcriptions'
56
52
  end
57
53
 
58
- it 'should set up a notifications resources object' do
59
- account = Twilio::REST::Account.new('someUri', 'someClient')
60
- account.respond_to?(:notifications).should == true
61
- account.notifications.instance_variable_get('@uri').should == 'someUri/Notifications'
54
+ it 'sets up a notifications resources object' do
55
+ @account.should respond_to(:notifications)
56
+ @account.notifications.instance_variable_get('@path').should == 'someUri/Notifications'
62
57
  end
63
58
  end
@@ -1,15 +1,18 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Twilio::REST::Call do
4
- it 'should set up a recordings resources object' do
5
- call = Twilio::REST::Call.new('someUri', 'someClient')
6
- call.respond_to?(:recordings).should == true
7
- call.recordings.instance_variable_get('@uri').should == 'someUri/Recordings'
4
+
5
+ before do
6
+ @call = Twilio::REST::Call.new('someUri', 'someClient')
7
+ end
8
+
9
+ it 'sets up a recordings resources object' do
10
+ @call.should respond_to(:recordings)
11
+ @call.recordings.instance_variable_get('@path').should == 'someUri/Recordings'
8
12
  end
9
13
 
10
- it 'should set up a notifications resources object' do
11
- call = Twilio::REST::Call.new('someUri', 'someClient')
12
- call.respond_to?(:notifications).should == true
13
- call.notifications.instance_variable_get('@uri').should == 'someUri/Notifications'
14
+ it 'sets up a notifications resources object' do
15
+ @call.should respond_to(:notifications)
16
+ @call.notifications.instance_variable_get('@path').should == 'someUri/Notifications'
14
17
  end
15
- end
18
+ end
@@ -77,14 +77,14 @@ describe Twilio::REST::Client do
77
77
 
78
78
  it 'should set up an accounts resources object' do
79
79
  twilio = Twilio::REST::Client.new('someSid', 'someToken')
80
- twilio.respond_to?(:accounts).should == true
81
- twilio.accounts.instance_variable_get('@uri').should == '/2010-04-01/Accounts'
80
+ twilio.should respond_to(:accounts)
81
+ twilio.accounts.instance_variable_get('@path').should == '/2010-04-01/Accounts'
82
82
  end
83
83
 
84
84
  it 'should set up an account object with the given sid' do
85
85
  twilio = Twilio::REST::Client.new('someSid', 'someToken')
86
- twilio.respond_to?(:account).should == true
87
- twilio.account.instance_variable_get('@uri').should == '/2010-04-01/Accounts/someSid'
86
+ twilio.should respond_to(:account)
87
+ twilio.account.instance_variable_get('@path').should == '/2010-04-01/Accounts/someSid'
88
88
  end
89
89
 
90
90
  it 'should convert all parameter names to Twilio-style names' do
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Twilio::REST::Conference do
4
4
  it 'should set up a participants resources object' do
5
5
  conference = Twilio::REST::Conference.new('someUri', 'someClient')
6
- conference.respond_to?(:participants).should == true
7
- conference.participants.instance_variable_get('@uri').should == 'someUri/Participants'
6
+ conference.should respond_to(:participants)
7
+ conference.participants.instance_variable_get('@path').should == 'someUri/Participants'
8
8
  end
9
9
  end
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Twilio::REST::InstanceResource do
4
4
  it 'should set up an internal reference to the uri and client' do
5
5
  resource = Twilio::REST::InstanceResource.new('some/uri', 'someClient')
6
- resource.instance_variable_get('@uri').should == 'some/uri'
6
+ resource.instance_variable_get('@path').should == 'some/uri'
7
7
  resource.instance_variable_get('@client').should == 'someClient'
8
8
  end
9
9
 
@@ -12,4 +12,4 @@ describe Twilio::REST::InstanceResource do
12
12
  resource = Twilio::REST::InstanceResource.new('uri', 'client', params)
13
13
  resource.some_key.should == 'someValue'
14
14
  end
15
- end
15
+ end
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Twilio::REST::Queue do
4
4
  it 'should set up a members resources object' do
5
5
  queue = Twilio::REST::Queue.new('someUri', 'someClient')
6
- queue.respond_to?(:members).should == true
7
- queue.members.instance_variable_get('@uri').should == 'someUri/Members'
6
+ queue.should respond_to(:members)
7
+ queue.members.instance_variable_get('@path').should == 'someUri/Members'
8
8
  end
9
9
  end
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Twilio::REST::Recording do
4
4
  it 'should set up a transcriptions resources object' do
5
5
  call = Twilio::REST::Recording.new('someUri', 'someClient')
6
- call.respond_to?(:transcriptions).should == true
7
- call.transcriptions.instance_variable_get('@uri').should == 'someUri/Transcriptions'
6
+ call.should respond_to(:transcriptions)
7
+ call.transcriptions.instance_variable_get('@path').should == 'someUri/Transcriptions'
8
8
  end
9
- end
9
+ end
metadata CHANGED
@@ -1,145 +1,137 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: twilio-ruby
3
- version: !ruby/object:Gem::Version
4
- hash: 35
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.10.0
5
5
  prerelease:
6
- segments:
7
- - 3
8
- - 9
9
- - 0
10
- version: 3.9.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Andrew Benton
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-10-19 00:00:00 -07:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2013-07-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: multi_json
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 27
30
- segments:
31
- - 1
32
- - 3
33
- - 0
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
34
21
  version: 1.3.0
35
22
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: builder
39
23
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.3.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: builder
32
+ requirement: !ruby/object:Gem::Requirement
41
33
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 15
46
- segments:
47
- - 2
48
- - 1
49
- - 2
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
50
37
  version: 2.1.2
51
38
  type: :runtime
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: jwt
55
39
  prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
57
41
  none: false
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- hash: 31
62
- segments:
63
- - 0
64
- - 1
65
- - 2
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 2.1.2
46
+ - !ruby/object:Gem::Dependency
47
+ name: jwt
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
66
53
  version: 0.1.2
67
54
  type: :runtime
68
- version_requirements: *id003
69
- - !ruby/object:Gem::Dependency
70
- name: rake
71
55
  prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
73
57
  none: false
74
- requirements:
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 0.1.2
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
75
67
  - - ~>
76
- - !ruby/object:Gem::Version
77
- hash: 59
78
- segments:
79
- - 0
80
- - 9
81
- - 0
68
+ - !ruby/object:Gem::Version
82
69
  version: 0.9.0
83
70
  type: :development
84
- version_requirements: *id004
85
- - !ruby/object:Gem::Dependency
86
- name: rspec
87
71
  prerelease: false
88
- requirement: &id005 !ruby/object:Gem::Requirement
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 0.9.0
78
+ - !ruby/object:Gem::Dependency
79
+ name: rspec
80
+ requirement: !ruby/object:Gem::Requirement
89
81
  none: false
90
- requirements:
82
+ requirements:
91
83
  - - ~>
92
- - !ruby/object:Gem::Version
93
- hash: 23
94
- segments:
95
- - 2
96
- - 6
97
- - 0
84
+ - !ruby/object:Gem::Version
98
85
  version: 2.6.0
99
86
  type: :development
100
- version_requirements: *id005
101
- - !ruby/object:Gem::Dependency
102
- name: fakeweb
103
87
  prerelease: false
104
- requirement: &id006 !ruby/object:Gem::Requirement
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 2.6.0
94
+ - !ruby/object:Gem::Dependency
95
+ name: fakeweb
96
+ requirement: !ruby/object:Gem::Requirement
105
97
  none: false
106
- requirements:
98
+ requirements:
107
99
  - - ~>
108
- - !ruby/object:Gem::Version
109
- hash: 27
110
- segments:
111
- - 1
112
- - 3
113
- - 0
100
+ - !ruby/object:Gem::Version
114
101
  version: 1.3.0
115
102
  type: :development
116
- version_requirements: *id006
117
- - !ruby/object:Gem::Dependency
118
- name: rack
119
103
  prerelease: false
120
- requirement: &id007 !ruby/object:Gem::Requirement
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 1.3.0
110
+ - !ruby/object:Gem::Dependency
111
+ name: rack
112
+ requirement: !ruby/object:Gem::Requirement
121
113
  none: false
122
- requirements:
114
+ requirements:
123
115
  - - ~>
124
- - !ruby/object:Gem::Version
125
- hash: 27
126
- segments:
127
- - 1
128
- - 3
129
- - 0
116
+ - !ruby/object:Gem::Version
130
117
  version: 1.3.0
131
118
  type: :development
132
- version_requirements: *id007
133
- description: A simple library for communicating with the Twilio REST API, building TwiML, and generating Twilio Client Capability Tokens
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: 1.3.0
126
+ description: A simple library for communicating with the Twilio REST API, building
127
+ TwiML, and generating Twilio Client Capability Tokens
134
128
  email: andrew@twilio.com
135
129
  executables: []
136
-
137
130
  extensions: []
138
-
139
- extra_rdoc_files:
131
+ extra_rdoc_files:
140
132
  - README.md
141
133
  - LICENSE
142
- files:
134
+ files:
143
135
  - .gitignore
144
136
  - .travis.yml
145
137
  - Gemfile
@@ -196,53 +188,46 @@ files:
196
188
  - spec/util/capability_spec.rb
197
189
  - spec/util/request_validator_spec.rb
198
190
  - twilio-ruby.gemspec
199
- has_rdoc: true
200
191
  homepage: http://github.com/twilio/twilio-ruby
201
- licenses:
192
+ licenses:
202
193
  - MIT
203
194
  post_install_message:
204
- rdoc_options:
195
+ rdoc_options:
205
196
  - --line-numbers
206
197
  - --inline-source
207
198
  - --title
208
199
  - twilio-ruby
209
200
  - --main
210
201
  - README.md
211
- require_paths:
202
+ require_paths:
212
203
  - lib
213
- required_ruby_version: !ruby/object:Gem::Requirement
204
+ required_ruby_version: !ruby/object:Gem::Requirement
214
205
  none: false
215
- requirements:
216
- - - ">="
217
- - !ruby/object:Gem::Version
218
- hash: 3
219
- segments:
220
- - 0
221
- version: "0"
222
- required_rubygems_version: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - ! '>='
208
+ - !ruby/object:Gem::Version
209
+ version: '0'
210
+ required_rubygems_version: !ruby/object:Gem::Requirement
223
211
  none: false
224
- requirements:
225
- - - ">="
226
- - !ruby/object:Gem::Version
227
- hash: 3
228
- segments:
229
- - 0
230
- version: "0"
212
+ requirements:
213
+ - - ! '>='
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
231
216
  requirements: []
232
-
233
217
  rubyforge_project:
234
- rubygems_version: 1.6.2
218
+ rubygems_version: 1.8.23
235
219
  signing_key:
236
220
  specification_version: 3
237
- summary: A simple library for communicating with the Twilio REST API, building TwiML, and generating Twilio Client Capability Tokens
238
- test_files:
221
+ summary: A simple library for communicating with the Twilio REST API, building TwiML,
222
+ and generating Twilio Client Capability Tokens
223
+ test_files:
239
224
  - spec/spec_helper.rb
240
- - spec/rest/queue_spec.rb
241
- - spec/rest/call_spec.rb
242
225
  - spec/rest/conference_spec.rb
243
- - spec/rest/account_spec.rb
226
+ - spec/rest/call_spec.rb
244
227
  - spec/rest/instance_resource_spec.rb
245
- - spec/rest/client_spec.rb
246
228
  - spec/rest/recording_spec.rb
229
+ - spec/rest/account_spec.rb
230
+ - spec/rest/client_spec.rb
231
+ - spec/rest/queue_spec.rb
247
232
  - spec/util/capability_spec.rb
248
233
  - spec/util/request_validator_spec.rb