Sha256: a2dac618aba816b58e4f7b100a94032c4507764776e56c080b171aa8ff8817e0

Contents?: true

Size: 696 Bytes

Versions: 7

Compression:

Stored size: 696 Bytes

Contents

require "base64"
require 'httparty'

require 'ruby-redtail/user'
require 'ruby-redtail/tag_group'
require 'ruby-redtail/exceptions'
require 'ruby-redtail/query'

require 'core_extensions/string'

module RubyRedtail
  class << self
    attr_accessor :config
  end

  def self.configure
    self.config ||= Configuration.new
    yield config
    raise RubyRedtail::InvalidURIError if (config.api_uri =~ URI::regexp).nil?
    raise RubyRedtail::AccessKeyError if (config.api_key.empty? || config.secret_key.empty?)
    config.api_uri << '/' unless config.api_uri[-1, 1] == '/'
  end

  class Configuration
    attr_accessor :api_key
    attr_accessor :api_uri
    attr_accessor :secret_key
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ruby-redtail-0.3.8 lib/ruby-redtail.rb
ruby-redtail-0.3.7 lib/ruby-redtail.rb
ruby-redtail-0.3.6 lib/ruby-redtail.rb
ruby-redtail-0.3.5 lib/ruby-redtail.rb
ruby-redtail-0.3.4 lib/ruby-redtail.rb
ruby-redtail-0.3.3 lib/ruby-redtail.rb
ruby-redtail-0.3.2 lib/ruby-redtail.rb