Sha256: c150aa2720bf4ae75a14d98a7d70dfa7762b9bc8a65f44c93d938d327d0ed117

Contents?: true

Size: 986 Bytes

Versions: 14

Compression:

Stored size: 986 Bytes

Contents

module PortaText
  module Command
    module Api
      # The me/dids/:did endpoint.
      # https://github.com/PortaText/docs/wiki/REST-API#api_did_settings
      #
      # Author::    Marcelo Gornstein (mailto:marcelog@portatext.com)
      # Copyright:: Copyright (c) 2015 PortaText
      # License::   Apache-2.0
      class DidSettings < Base
        def for_number(number)
          set :id, number
        end

        def disable_cnam
          set :cnam_enabled, false
        end

        def enable_cnam
          set :cnam_enabled, true
        end

        def dont_autorespond
          set :autoresponder_enabled, false
        end

        def autorespond_with(text)
          set :autoresponder_text, text
          set :autoresponder_enabled, true
        end

        def endpoint(_method)
          fail 'DID number cant be null' if @args[:id].nil?
          id = @args[:id]
          @args.delete :id
          "me/dids/#{id}"
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
portatext-1.1.10 lib/portatext/command/api/did_settings.rb
portatext-1.1.9 lib/portatext/command/api/did_settings.rb
portatext-1.1.8 lib/portatext/command/api/did_settings.rb
portatext-1.1.7 lib/portatext/command/api/did_settings.rb
portatext-1.1.6 lib/portatext/command/api/did_settings.rb
portatext-1.1.5 lib/portatext/command/api/did_settings.rb
portatext-1.1.4 lib/portatext/command/api/did_settings.rb
portatext-1.1.3 lib/portatext/command/api/did_settings.rb
portatext-1.1.2 lib/portatext/command/api/did_settings.rb
portatext-1.1.1 lib/portatext/command/api/did_settings.rb
portatext-1.1.0 lib/portatext/command/api/did_settings.rb
portatext-1.0.0 lib/portatext/command/api/did_settings.rb
portatext-1.0.0.pre lib/portatext/command/api/did_settings.rb
portatext-0.0.2 lib/portatext/command/api/did_settings.rb