Permalink
Browse files

converting all uri references to path

  • Loading branch information...
1 parent ac11089 commit 737ca6e915db6a8ebaa506dee4a8ac8f353b990e @andrewmbenton andrewmbenton committed Jul 14, 2013
@@ -3,8 +3,8 @@ module REST
class Accounts < ListResource; end
class Account < InstanceResource
- def initialize(uri, client, params={})
- super uri, client, params
+ def initialize(path, client, params={})
+ super path, client, params
resource :sandbox, :available_phone_numbers, :incoming_phone_numbers,
:calls, :outgoing_caller_ids, :conferences, :sms, :recordings,
:transcriptions, :notifications, :applications, :connect_apps,
@@ -1,8 +1,8 @@
module Twilio
module REST
class Country < InstanceResource
- def initialize(uri, client, params={})
- super uri, client, params
+ def initialize(path, client, params={})
+ super path, client, params
resource :local, :toll_free
end
end
@@ -7,8 +7,8 @@ def make(from, to, url)
end
class Call < InstanceResource
- def initialize(uri, client, params={})
- super uri, client, params
+ def initialize(path, client, params={})
+ super path, client, params
resource :recordings, :notifications
end
@@ -3,8 +3,8 @@ module REST
class Conferences < ListResource; end
class Conference < InstanceResource
- def initialize(uri, client, params={})
- super uri, client, params
+ def initialize(path, client, params={})
+ super path, client, params
resource :participants
end
end
@@ -1,7 +1,7 @@
module Twilio
module REST
class Participants < ListResource
- def initialize(uri, client)
+ def initialize(path, client)
super
# hard-code the json key since participants don't have sids
@instance_id_key = 'call_sid'
@@ -3,8 +3,8 @@ module REST
class Queues < ListResource; end
class Queue < InstanceResource
- def initialize(uri, client, params={})
- super uri, client, params
+ def initialize(path, client, params={})
+ super path, client, params
resource :members
end
end
@@ -1,14 +1,14 @@
module Twilio
module REST
class Members < ListResource
- def initialize(uri, client)
+ def initialize(path, client)
super
# hard-code the json keys since members are special
@list_key, @instance_id_key = 'queue_members', 'call_sid'
end
def front
- @instance_class.new "#{@uri}/Front", @client
+ @instance_class.new "#{@path}/Front", @client
end
def front!
@@ -1,8 +1,8 @@
module Twilio
module REST
class Sms < InstanceResource
- def initialize(uri, client, params={})
- super uri, client, params
+ def initialize(path, client, params={})
+ super path, client, params
resource :messages, :short_codes
end
end
@@ -1,7 +1,7 @@
module Twilio
module REST
class Messages < ListResource
- def initialize(uri, client)
+ def initialize(path, client)
super
# hard-code the json key since 'messages' doesn't exist in the response
@list_key = 'sms_messages'
@@ -1,7 +1,7 @@
module Twilio
module REST
class Usage < InstanceResource
- def initialize(uri, client, params={})
+ def initialize(path, client, params={})
super
resource :records, :triggers
end
@@ -5,14 +5,14 @@ class Records < ListResource
SUBRESOURCES = [:daily, :monthly, :yearly, :all_time, :today, :yesterday,
:this_month, :last_month]
- def initialize(uri, client)
+ def initialize(path, client)
super
@list_key = 'usage_records'
end
def method_missing(method, *args)
super unless SUBRESOURCES.include? method
- self.class.new "#{@uri}/#{twilify(method)}", @client
+ self.class.new "#{@path}/#{twilify(method)}", @client
end
end
@@ -1,7 +1,7 @@
module Twilio
module REST
class Triggers < ListResource
- def initialize(uri, client)
+ def initialize(path, client)
super
@list_key = 'usage_triggers'
end

0 comments on commit 737ca6e

Please sign in to comment.