Sha256: 980b5e679b41923361fdcc6278366bf4fce9de81d31e9bee7c9e695b3e23216b

Contents?: true

Size: 828 Bytes

Versions: 1

Compression:

Stored size: 828 Bytes

Contents

require 'active_support'
require 'active_support/core_ext'
require 'nokogiri'
require 'yaml'
require 'openssl'
require 'mechanize'
require 'digest/md5'

require "skio_sms_client/version"

module SkioSmsClient
  class << self
    def configuration
      @configuration ||= begin
        if defined? Rails
          config_file = Rails.root.join('config/skio_sms_client.yml')
        else
          config_file = File.expand_path('../../config/skio_sms_client.yml', __FILE__)
        end

        if (File.exist?(config_file))
          config = YAML.load(ERB.new(File.new(config_file).read).result)
          config = config[Rails.env] if defined? Rails
        end
        OpenStruct.new(config || {app_name: "", send_key: "", send_server: ""})
      end
    end

    def configure
      yield(configuration)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
skio_sms_client-0.1.0 lib/skio_sms_client.rb