Class: Twilio::REST::Records

Inherits:
ListResource show all
Defined in:
lib/twilio-ruby/rest/usage/records.rb

Constant Summary collapse

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

Instance Method Summary collapse

Methods inherited from ListResource

#create, #get, #inspect, #list

Methods included from Utils

#detwilify, #twilify

Constructor Details

#initialize(path, client) ⇒ Records

Returns a new instance of Records.



8
9
10
11
# File 'lib/twilio-ruby/rest/usage/records.rb', line 8

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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



13
14
15
16
# File 'lib/twilio-ruby/rest/usage/records.rb', line 13

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