Sha256: 3033084939829127871893e04e2a832056a8eef14c11513ea83601b8b105c763

Contents?: true

Size: 992 Bytes

Versions: 1

Compression:

Stored size: 992 Bytes

Contents

require 'logger'
require 'active_support/core_ext/hash'
require 'faraday'
require 'faraday_middleware'
require 'faraday_middleware/response/mashrashify'
require 'nexmos/version'
require 'nexmos/base'
module Nexmos
  extend self
  attr_accessor :api_key, :api_secret, :debug
  attr_writer :user_agent, :logger

  # ensures the setup only gets run once
  @_ran_once = false

  def reset!
    @logger = nil
    @_ran_once = false
    @user_agent = nil
    @api_key = nil
    @api_secret = nil
  end

  def user_agent
    @user_agent ||= "Nexmos v#{::Nexmos::VERSION}"
  end

  def setup
    yield self unless @_ran_once
    @_ran_once = true
  end

  def logger
    @logger ||= Logger.new(STDOUT)
  end

  def apis
    @apis ||= YAML.load_file(File.expand_path('api.yml', File.dirname(__FILE__)))
  end

  reset!
end

require 'nexmos/railties' if defined?(::Rails)
require 'nexmos/account'
require 'nexmos/message'
require 'nexmos/number'
require 'nexmos/search'
require 'nexmos/text_to_speech'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nexmos-0.3 lib/nexmos.rb