Sha256: 88e1786f15a85383247034121a6904a75baba3c8aa7d7934b24d4bc297262805

Contents?: true

Size: 930 Bytes

Versions: 7

Compression:

Stored size: 930 Bytes

Contents

module Twilio
  module REST
    module SMS
      
      module Deprecation
        def deprecate(method_name)
          old_method = "_deprecated_#{method_name}"
          alias_method old_method, method_name
          define_method method_name do |*args, &block|
            warn "[DEPRECATED] SMS Resource is deprecated. Please use Messages (https://www.twilio.com/docs/api/rest/message)"
            send old_method, *args, &block
          end
        end
      end

      class Messages < ListResource
        extend Deprecation
         
        deprecate :list
        deprecate :total
        deprecate :get
        deprecate :create

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

      class Message < InstanceResource
        extend Deprecation

        deprecate :update
        deprecate :refresh
        deprecate :delete
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
twilio-ruby-3.16.1 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-3.16.0 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-3.15.2 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-3.15.1 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-3.15.0 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-3.14.5 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-3.14.4 lib/twilio-ruby/rest/sms/messages.rb