Class: SuperReceptionist::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/super_receptionist/base.rb

Instance Method Summary collapse

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(options)
  SuperReceptionist.api_host        = options.fetch(:api_host)        { "kpi.knowlarity.com" }
  SuperReceptionist.protocol        = options.fetch(:protocol)        { "https" }
  SuperReceptionist.api_version     = options.fetch(:api_version)     { "v1" }
  SuperReceptionist.test_mode       = options.fetch(:test_mode)       { false }
  SuperReceptionist.channel         = options.fetch(:channel)         { raise ArgumentError.new(":channel is a required argument to initialize SuperReceptionist") if SuperReceptionist.channel.nil? }
  SuperReceptionist.x_api_key       = options.fetch(:x_api_key)       { raise ArgumentError.new(":x_api_key is a required argument to initialize SuperReceptionist") if SuperReceptionist.x_api_key.nil? }
  SuperReceptionist.authorization   = options.fetch(:authorization)   { raise ArgumentError.new(":authorization is a required argument to initialize SuperReceptionist") if SuperReceptionist.authorization.nil? }
end

Instance Method Details

#agentObject



21
22
23
# File 'lib/super_receptionist/base.rb', line 21

def agent
  SuperReceptionist::Agent.new(self)
end

#base_urlObject



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

#callObject



17
18
19
# File 'lib/super_receptionist/base.rb', line 17

def call
  SuperReceptionist::Call.new(self)
end

#circleObject



29
30
31
# File 'lib/super_receptionist/base.rb', line 29

def circle
  SuperReceptionist::Circle.new(self)
end

#compaignObject



25
26
27
# File 'lib/super_receptionist/base.rb', line 25

def compaign
  SuperReceptionist::Compaign.new(self)
end

#notificationObject



33
34
35
# File 'lib/super_receptionist/base.rb', line 33

def notification
  SuperReceptionist::Notification.new(self)
end

#numberObject



37
38
39
# File 'lib/super_receptionist/base.rb', line 37

def number
  SuperReceptionist::Number.new(self)
end

#phonebookObject



41
42
43
# File 'lib/super_receptionist/base.rb', line 41

def phonebook
  SuperReceptionist::Phonebook.new(self)
end

#planObject



45
46
47
# File 'lib/super_receptionist/base.rb', line 45

def plan
  SuperReceptionist::Plan.new(self)
end

#soundObject



49
50
51
# File 'lib/super_receptionist/base.rb', line 49

def sound
  SuperReceptionist::Sound.new(self)
end

#taskObject



53
54
55
# File 'lib/super_receptionist/base.rb', line 53

def task
  SuperReceptionist::Task.new(self)
end