Sha256: 8e057b285e25062b1dddde90843ec11cde8e2dfd0bb9fc3e1db931e00bd03f33

Contents?: true

Size: 650 Bytes

Versions: 8

Compression:

Stored size: 650 Bytes

Contents

module TwilioContactable
  class << self
    def mode
      @@mode ||= :test
    end

    def mode=(new_mode)
      @@mode = new_mode
    end

    def configured?
      return false unless configuration
      configuration.client_id && configuration.client_key
    end

    def configuration
      @configuration ||= Configuration.new
    end

    def configure(&block)
      @configuration = Configuration.new(&block)
    end
  end

  class Configuration

    attr_accessor :client_id
    attr_accessor :client_key
    attr_accessor :website_address
    attr_accessor :default_from_phone_number

    def initialize
      yield self
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
twilio_contactable-0.8.9 lib/configuration.rb
twilio_contactable-0.8.8 lib/configuration.rb
twilio_contactable-0.8.7 lib/configuration.rb
twilio_contactable-0.8.5 lib/configuration.rb
twilio_contactable-0.8.4 lib/configuration.rb
twilio_contactable-0.8.3 lib/configuration.rb
twilio_contactable-0.8.2 lib/configuration.rb
twilio_contactable-0.8.1 lib/configuration.rb