Class: PortaText::Command::Api::DidSettings

Inherits:
Base
  • Object
show all
Defined in:
lib/portatext/command/api/did_settings.rb

Overview

The dids/:did endpoint. github.com/PortaText/docs/wiki/REST-API#api_did_settings

Author

Marcelo Gornstein ([email protected])

Copyright

Copyright © 2015 PortaText

License

Apache-2.0

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#accept_content_type, #body, #content_type, #delete, #get, #initialize, #patch, #post, #put, #set

Constructor Details

This class inherits a constructor from PortaText::Command::Base

Instance Method Details

#autorespond_with(text) ⇒ Object



35
36
37
38
# File 'lib/portatext/command/api/did_settings.rb', line 35

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

#disable_cnamObject



23
24
25
# File 'lib/portatext/command/api/did_settings.rb', line 23

def disable_cnam
  set :cnam_enabled, false
end

#disable_stop_wordsObject



15
16
17
# File 'lib/portatext/command/api/did_settings.rb', line 15

def disable_stop_words
  set :stop_words_enabled, false
end

#dont_autorespondObject



31
32
33
# File 'lib/portatext/command/api/did_settings.rb', line 31

def dont_autorespond
  set :autoresponder_enabled, false
end

#enable_cnamObject



27
28
29
# File 'lib/portatext/command/api/did_settings.rb', line 27

def enable_cnam
  set :cnam_enabled, true
end

#enable_stop_wordsObject



19
20
21
# File 'lib/portatext/command/api/did_settings.rb', line 19

def enable_stop_words
  set :stop_words_enabled, true
end

#endpoint(_method) ⇒ Object



40
41
42
43
44
45
# File 'lib/portatext/command/api/did_settings.rb', line 40

def endpoint(_method)
  id = @args[:id]
  @args.delete :id
  return "dids/#{id}" unless id.nil?
  'dids'
end

#for_number(number) ⇒ Object



11
12
13
# File 'lib/portatext/command/api/did_settings.rb', line 11

def for_number(number)
  set :id, number
end