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.13.0 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.12.1 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.11.1 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.11.0 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.10.0.edge lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.10.0 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.9.1 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.9.1.edge lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.9.0 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.9.0.edge lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.8.0 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.7.0 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.8.3.edge lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.8.2.edge lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.8.1.edge lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.8.0.edge lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.6.2 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.6.1 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.6.0 lib/twilio-ruby/rest/sms/messages.rb
twilio-ruby-4.7.0.edge lib/twilio-ruby/rest/sms/messages.rb