Sha256: 677ac4902ccc531e12df79301d867eebb244b54b4d048060afd758426d72adfe

Contents?: true

Size: 630 Bytes

Versions: 1

Compression:

Stored size: 630 Bytes

Contents

module Wordsmith
  class Configuration
    attr_accessor :token, :user_agent, :version
    DEFAULT_VERSION = '1'
    DEFAULT_USER_AGENT = "RubySDK/#{Wordsmith::VERSION}"
    URL_HOST = 'https://api.automatedinsights.com'
    DEFAULT_URL = "#{URL_HOST}/v#{DEFAULT_VERSION}"

    def initialize
      @version = DEFAULT_VERSION
      @user_agent = DEFAULT_USER_AGENT
    end

    def url
      "#{URL_HOST}/v#{version}"
    end
  end

  module_function

  def configuration
    @_configuration ||= Configuration.new
  end

  def configure
    yield configuration
  end

  def reset
    @_configuration = Configuration.new
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wordsmith-ruby-sdk-2.0.0 lib/wordsmith/configuration.rb