Class: SuperReceptionist::Base
- Inherits:
-
Object
- Object
- SuperReceptionist::Base
- Defined in:
- lib/super_receptionist/base.rb
Instance Method Summary collapse
- #agent ⇒ Object
- #base_url ⇒ Object
- #call ⇒ Object
- #circle ⇒ Object
- #compaign ⇒ Object
-
#initialize(options) ⇒ Base
constructor
A new instance of Base.
- #notification ⇒ Object
- #number ⇒ Object
- #phonebook ⇒ Object
- #plan ⇒ Object
- #sound ⇒ Object
- #task ⇒ Object
Constructor Details
#initialize(options) ⇒ Base
Returns a new instance of Base.
3 4 5 6 7 8 9 10 11 |
# File 'lib/super_receptionist/base.rb', line 3 def initialize() SuperReceptionist.api_host = .fetch(:api_host) { "kpi.knowlarity.com" } SuperReceptionist.protocol = .fetch(:protocol) { "https" } SuperReceptionist.api_version = .fetch(:api_version) { "v1" } SuperReceptionist.test_mode = .fetch(:test_mode) { false } SuperReceptionist.channel = .fetch(:channel) { raise ArgumentError.new(":channel is a required argument to initialize SuperReceptionist") if SuperReceptionist.channel.nil? } SuperReceptionist.x_api_key = .fetch(:x_api_key) { raise ArgumentError.new(":x_api_key is a required argument to initialize SuperReceptionist") if SuperReceptionist.x_api_key.nil? } SuperReceptionist. = .fetch(:authorization) { raise ArgumentError.new(":authorization is a required argument to initialize SuperReceptionist") if SuperReceptionist..nil? } end |
Instance Method Details
#agent ⇒ Object
21 22 23 |
# File 'lib/super_receptionist/base.rb', line 21 def agent SuperReceptionist::Agent.new(self) end |
#base_url ⇒ Object
13 14 15 |
# File 'lib/super_receptionist/base.rb', line 13 def base_url "#{SuperReceptionist.protocol}://#{SuperReceptionist.api_host}/#{SuperReceptionist.channel}/#{SuperReceptionist.api_version}/" end |
#call ⇒ Object
17 18 19 |
# File 'lib/super_receptionist/base.rb', line 17 def call SuperReceptionist::Call.new(self) end |
#circle ⇒ Object
29 30 31 |
# File 'lib/super_receptionist/base.rb', line 29 def circle SuperReceptionist::Circle.new(self) end |
#compaign ⇒ Object
25 26 27 |
# File 'lib/super_receptionist/base.rb', line 25 def compaign SuperReceptionist::Compaign.new(self) end |
#notification ⇒ Object
33 34 35 |
# File 'lib/super_receptionist/base.rb', line 33 def notification SuperReceptionist::Notification.new(self) end |
#number ⇒ Object
37 38 39 |
# File 'lib/super_receptionist/base.rb', line 37 def number SuperReceptionist::Number.new(self) end |
#phonebook ⇒ Object
41 42 43 |
# File 'lib/super_receptionist/base.rb', line 41 def phonebook SuperReceptionist::Phonebook.new(self) end |
#plan ⇒ Object
45 46 47 |
# File 'lib/super_receptionist/base.rb', line 45 def plan SuperReceptionist::Plan.new(self) end |
#sound ⇒ Object
49 50 51 |
# File 'lib/super_receptionist/base.rb', line 49 def sound SuperReceptionist::Sound.new(self) end |
#task ⇒ Object
53 54 55 |
# File 'lib/super_receptionist/base.rb', line 53 def task SuperReceptionist::Task.new(self) end |