Module: FmRest

Defined in:
lib/fmrest.rb,
lib/fmrest/v1.rb,
lib/fmrest/errors.rb,
lib/fmrest/v1/auth.rb,
lib/fmrest/version.rb,
lib/fmrest/v1/dates.rb,
lib/fmrest/v1/paths.rb,
lib/fmrest/v1/utils.rb,
lib/fmrest/string_date.rb,
lib/fmrest/token_store.rb,
lib/fmrest/v1/connection.rb,
lib/fmrest/v1/raise_errors.rb,
lib/fmrest/v1/type_coercer.rb,
lib/fmrest/token_store/base.rb,
lib/fmrest/token_store/null.rb,
lib/fmrest/v1/token_session.rb,
lib/fmrest/token_store/redis.rb,
lib/fmrest/token_store/memory.rb,
lib/fmrest/token_store/moneta.rb,
lib/fmrest/connection_settings.rb,
lib/fmrest/v1/container_fields.rb,
lib/fmrest/v1/token_store/memory.rb,
lib/fmrest/token_store/short_memory.rb,
lib/fmrest/token_store/active_record.rb,
lib/fmrest/v1/token_store/active_record.rb

Defined Under Namespace

Modules: StringDateAwareness, TokenStore, V1 Classes: APIError, ConnectionSettings, ContainerFieldError, Error, StringDate, StringDateTime

Constant Summary collapse

VERSION =
"0.26.3"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject



42
43
44
45
46
47
48
49
50
# File 'lib/fmrest.rb', line 42

def logger
  @logger ||=
    if defined?(Rails)
      Rails.logger
    else
      require "logger"
      Logger.new($stdout)
    end
end

.token_storeObject

Returns the value of attribute token_store.



18
19
20
# File 'lib/fmrest.rb', line 18

def token_store
  @token_store
end

Class Method Details

.configObject



37
38
39
40
# File 'lib/fmrest.rb', line 37

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

.config=(connection_hash) ⇒ Object



32
33
34
35
# File 'lib/fmrest.rb', line 32

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

.default_connection_settingsObject



28
29
30
# File 'lib/fmrest.rb', line 28

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

.default_connection_settings=(settings) ⇒ Object



21
22
23
24
25
26
# File 'lib/fmrest.rb', line 21

def default_connection_settings=(settings)
  # Skip validation since we may use the defaults for half-complete
  # settings
  @default_connection_settings =
    ConnectionSettings.wrap(settings, skip_validation: true)
end

.e(s) ⇒ Object

Shortcut for FmRest::V1.escape_find_operators



55
56
57
# File 'lib/fmrest.rb', line 55

def e(s)
  V1.escape_find_operators(s)
end

.Layout(*_) ⇒ Object



59
60
61
62
# File 'lib/fmrest.rb', line 59

def Layout(*_)
  require "fmrest/spyke"
  self.Layout(*_)
end

.require_cloud_supportObject



64
65
66
67
68
69
# File 'lib/fmrest.rb', line 64

def require_cloud_support
  require "fmrest/cloud"
rescue LoadError => e
  e.message << " (Did you include fmrest-cloud in your Gemfile?)" unless e.message.frozen?
  raise e
end