Module: Voicepartner

Defined in:
lib/voicepartner.rb,
lib/voicepartner/client.rb,
lib/voicepartner/version.rb,
lib/voicepartner/configurator.rb

Defined Under Namespace

Classes: Client

Constant Summary collapse

VERSION =
'0.1.0'.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.clientObject

Returns the value of attribute client.



19
20
21
# File 'lib/voicepartner.rb', line 19

def client
  @client
end

.configurationObject

Returns the value of attribute configuration.



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

def configuration
  @configuration
end

Class Method Details

.configure {|configurator| ... } ⇒ Object

Yields:

  • (configurator)


8
9
10
11
12
13
14
15
# File 'lib/voicepartner.rb', line 8

def configure
  raise 'You need to provide a block to configure' unless block_given?

  configurator = Configurator.new
  yield configurator
  self.configuration = configurator.config
  self.client = Client.new(self.configuration)
end

.send_vocal_message(to:, message_text:) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/voicepartner.rb', line 21

def send_vocal_message(to:, message_text:)
  if client.nil?
    raise 'Initialization Error: ' \
    'You must call Voicepartner.configure before calling send_vocal_message'
  end

  client.send_vocal_message(to: to, message_text: message_text)
end