Module: BetterFx

Defined in:
lib/better_fx.rb,
lib/better_fx/client.rb,
lib/better_fx/version.rb,
lib/better_fx/measurement.rb,
lib/better_fx/configuration.rb

Defined Under Namespace

Modules: Measurement Classes: Client, Configuration

Constant Summary collapse

VERSION =
"2.0.0".freeze
VERSION_DATE =
"2017-04-03".freeze

Class Method Summary collapse

Class Method Details

.configurationConfiguration

Returns the singleton class’s configuration object

Returns:



23
24
25
# File 'lib/better_fx.rb', line 23

def configuration
  @configuration ||= Configuration.new
end

.configure(opts = {}) {|configuration| ... } ⇒ Configuration

Allows the user to set configuration options

by yielding the configuration block

Parameters:

  • opts (Hash) (defaults to: {})

    an optional hash of options, supported options are ‘reset: true`

Yields:

Returns:



14
15
16
17
18
# File 'lib/better_fx.rb', line 14

def configure(opts = {})
  @configuration = nil if opts.key?(:reset) && opts[:reset]
  yield(configuration) if block_given?
  configuration
end

.configured?Bool

Returns true if BetterFx has been configured, false otherwise

Returns:

  • (Bool)

    true if BetterFx is configured, false otherwise



30
31
32
# File 'lib/better_fx.rb', line 30

def configured?
  !@configuration.nil?
end