Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmbenton committed Oct 19, 2012
2 parents 58440a2 + f4f26ab commit 6cdc0b3
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/twilio-ruby.rb
Expand Up @@ -35,6 +35,9 @@
require 'twilio-ruby/rest/conferences/participants'
require 'twilio-ruby/rest/queues'
require 'twilio-ruby/rest/queues/members'
require 'twilio-ruby/rest/usage'
require 'twilio-ruby/rest/usage/records'
require 'twilio-ruby/rest/usage/triggers'
require 'twilio-ruby/rest/recordings'
require 'twilio-ruby/rest/transcriptions'
require 'twilio-ruby/rest/notifications'
Expand Down
2 changes: 1 addition & 1 deletion lib/twilio-ruby/rest/accounts.rb
Expand Up @@ -8,7 +8,7 @@ def initialize(uri, client, params={})
resource :sandbox, :available_phone_numbers, :incoming_phone_numbers,
:calls, :outgoing_caller_ids, :conferences, :sms, :recordings,
:transcriptions, :notifications, :applications, :connect_apps,
:authorized_connect_apps, :queues
:authorized_connect_apps, :queues, :usage
end
end
end
Expand Down
10 changes: 10 additions & 0 deletions lib/twilio-ruby/rest/usage.rb
@@ -0,0 +1,10 @@
module Twilio
module REST
class Usage < InstanceResource
def initialize(uri, client, params={})
super
resource :records, :triggers
end
end
end
end
21 changes: 21 additions & 0 deletions lib/twilio-ruby/rest/usage/records.rb
@@ -0,0 +1,21 @@
module Twilio
module REST
class Records < ListResource

SUBRESOURCES = [:daily, :monthly, :yearly, :all_time, :today, :yesterday,
:this_month, :last_month]

def initialize(uri, client)
super
@list_key = 'usage_records'
end

def method_missing(method, *args)
super unless SUBRESOURCES.include? method
self.class.new "#{@uri}/#{twilify(method)}", @client
end
end

class Record < InstanceResource; end
end
end
12 changes: 12 additions & 0 deletions lib/twilio-ruby/rest/usage/triggers.rb
@@ -0,0 +1,12 @@
module Twilio
module REST
class Triggers < ListResource
def initialize(uri, client)
super
@list_key = 'usage_triggers'
end
end

class Trigger < InstanceResource; end
end
end
2 changes: 1 addition & 1 deletion lib/twilio-ruby/version.rb
@@ -1,3 +1,3 @@
module Twilio
VERSION = '3.8.0'
VERSION = '3.9.0'
end

0 comments on commit 6cdc0b3

Please sign in to comment.