Sha256: 6ea8ad88a8fdd75dc754cea6074683e7373ffe45b7f9c673be14631ce71afa57

Contents?: true

Size: 441 Bytes

Versions: 6

Compression:

Stored size: 441 Bytes

Contents

module Reviewed
  module Configurable

    class << self

      def options
        {
          api_key: nil,
          base_uri: 'http://localhost:3000/api',
          api_version: 'v1'
        }
      end
    end

    def configure
      yield self
      self
    end

    def verify_key!
      unless Reviewed.api_key
        raise ConfigurationError.new("Please set Reviewed.api_key before making a request")
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
reviewed-0.1.2 lib/reviewed/configurable.rb
reviewed-0.1.1 lib/reviewed/configurable.rb
reviewed-0.1.0 lib/reviewed/configurable.rb
reviewed-0.0.9 lib/reviewed/configurable.rb
reviewed-0.0.8 lib/reviewed/configurable.rb
reviewed-0.0.7 lib/reviewed/configurable.rb