Sha256: 490175f8c035b128d494733f475cd02dfe28698c9ff439098039c4524bed66b0

Contents?: true

Size: 905 Bytes

Versions: 29

Compression:

Stored size: 905 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 :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

29 entries across 29 versions & 1 rubygems

Version Path
twilio-ruby-4.6.0.edge lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.5.0 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.4.0 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.3.0 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.2.1 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.2.0 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.1.0 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.0.1 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.0.0 lib/twilio-ruby/rest/sms/messages.rb