Module: Twi::Config

Included in:
Twi
Defined in:
lib/twi/config.rb

Overview

Provides methods to read and write global configuration settings.

A typical usage is to set the sid and secret to interact with Twilio API.

Note that Twi.configure has precedence over values through with environment variables (see Lio).

Examples:

Set the sid and secret to interact with Twilio API:

Twi.configure do |twilio|
  twilio.sid = 'AC8776d'
  twilio.secret = '588213'
end

Instance Method Summary collapse

Instance Method Details

#configure {|Twi::Lio| ... } ⇒ Object

Yields the global configuration to the given block.

Examples:

Twi.configure do |twilio|
  twilio.sid = 'AC8776d'
end

Yields:

  • (Twi::Lio)

    The global configuration.



25
26
27
# File 'lib/twi/config.rb', line 25

def configure
  yield lio if block_given?
end

#lioTwi::Lio

Returns The global configuration.

Returns:

  • (Twi::Lio)

    The global configuration.



30
31
32
# File 'lib/twi/config.rb', line 30

def lio
  @lio ||= Twi::Lio.new
end