Sha256: 497314426885066e8edba2c13677f9180a712847418a09bcf52e4c2edc705405

Contents?: true

Size: 976 Bytes

Versions: 2

Compression:

Stored size: 976 Bytes

Contents

# frozen_string_literal: true

require "faraday"
require "faraday_middleware"

require "fmrest/version"
require "fmrest/connection_settings"

require "fmrest/errors"

module FmRest
  autoload :V1,         "fmrest/v1"
  autoload :TokenStore, "fmrest/token_store"

  class << self
    attr_accessor :token_store

    def default_connection_settings=(settings)
      @default_connection_settings = ConnectionSettings.wrap(settings, skip_validation: true)
    end

    def default_connection_settings
      @default_connection_settings || ConnectionSettings.new({}, skip_validation: true)
    end

    def config=(connection_hash)
      warn "[DEPRECATION] `FmRest.config=` is deprecated, use `FmRest.default_connection_settings=` instead"
      self.default_connection_settings = connection_hash
    end

    def config
      warn "[DEPRECATION] `FmRest.config` is deprecated, use `FmRest.default_connection_settings` instead"
      default_connection_settings
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fmrest-0.12.0 lib/fmrest.rb
fmrest-0.11.1 lib/fmrest.rb