Module: Unleash

Defined in:
lib/unleash.rb,
lib/unleash/client.rb,
lib/unleash/context.rb,
lib/unleash/metrics.rb,
lib/unleash/variant.rb,
lib/unleash/version.rb,
lib/unleash/util/http.rb,
lib/unleash/constraint.rb,
lib/unleash/configuration.rb,
lib/unleash/strategy/base.rb,
lib/unleash/strategy/util.rb,
lib/unleash/feature_toggle.rb,
lib/unleash/toggle_fetcher.rb,
lib/unleash/metrics_reporter.rb,
lib/unleash/strategy/default.rb,
lib/unleash/variant_override.rb,
lib/unleash/bootstrap/handler.rb,
lib/unleash/scheduled_executor.rb,
lib/unleash/variant_definition.rb,
lib/unleash/activation_strategy.rb,
lib/unleash/strategy/user_with_id.rb,
lib/unleash/bootstrap/configuration.rb,
lib/unleash/bootstrap/provider/base.rb,
lib/unleash/strategy/remote_address.rb,
lib/unleash/strategy/flexible_rollout.rb,
lib/unleash/bootstrap/provider/from_url.rb,
lib/unleash/bootstrap/provider/from_file.rb,
lib/unleash/strategy/application_hostname.rb,
lib/unleash/strategy/gradual_rollout_random.rb,
lib/unleash/strategy/gradual_rollout_userid.rb,
lib/unleash/strategy/gradual_rollout_sessionid.rb

Defined Under Namespace

Modules: Bootstrap, Strategy, Util Classes: ActivationStrategy, Client, Configuration, Constraint, Context, FeatureToggle, Metrics, MetricsReporter, ScheduledExecutor, ToggleFetcher, Variant, VariantDefinition, VariantOverride

Constant Summary collapse

TIME_RESOLUTION =
3
STRATEGIES =
Unleash::Strategy.constants
.select{ |c| Unleash::Strategy.const_get(c).is_a? Class }
.reject{ |c| ['NotImplemented', 'Base'].include?(c.to_s) }
.map do |c|
  lowered_c = c.to_s
  lowered_c[0] = lowered_c[0].downcase
  [lowered_c.to_sym, Object.const_get("Unleash::Strategy::#{c}").new]
end
.to_h
VERSION =
"4.3.0".freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



24
25
26
# File 'lib/unleash.rb', line 24

def configuration
  @configuration
end

.loggerObject

Returns the value of attribute logger.



24
25
26
# File 'lib/unleash.rb', line 24

def logger
  @logger
end

.reporterObject

Returns the value of attribute reporter.



24
25
26
# File 'lib/unleash.rb', line 24

def reporter
  @reporter
end

.toggle_fetcherObject

Returns the value of attribute toggle_fetcher.



24
25
26
# File 'lib/unleash.rb', line 24

def toggle_fetcher
  @toggle_fetcher
end

.toggle_metricsObject

Returns the value of attribute toggle_metrics.



24
25
26
# File 'lib/unleash.rb', line 24

def toggle_metrics
  @toggle_metrics
end

.togglesObject

Returns the value of attribute toggles.



24
25
26
# File 'lib/unleash.rb', line 24

def toggles
  @toggles
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Support for configuration via yield:

Yields:



28
29
30
31
32
33
34
# File 'lib/unleash.rb', line 28

def self.configure
  self.configuration ||= Unleash::Configuration.new
  yield(configuration)

  self.configuration.validate!
  self.configuration.refresh_backup_file!
end