Module: Featureflow

Defined in:
lib/featureflow.rb,
lib/featureflow/client.rb,
lib/featureflow/feature.rb,
lib/featureflow/version.rb,
lib/featureflow/evaluate.rb,
lib/featureflow/conditions.rb,
lib/featureflow/events_client.rb,
lib/featureflow/rails/railtie.rb,
lib/featureflow/polling_client.rb,
lib/featureflow/context_builder.rb,
lib/featureflow/evaluate_helpers.rb,
lib/featureflow/rails/rails_client.rb

Defined Under Namespace

Classes: Client, Conditions, ContextBuilder, Evaluate, EvaluateHelpers, EventsClient, Feature, FeatureflowRailtie, PollingClient, RailsClient

Constant Summary collapse

VERSION =
"0.4.0"
LOCK =
Mutex.new

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject



10
11
12
13
14
# File 'lib/featureflow.rb', line 10

def logger
  @logger ||= Logger.new($stderr).tap do |log|
    log.progname = self.name
  end
end

Class Method Details

.configurationObject

Configuration getters



16
17
18
19
# File 'lib/featureflow/rails/railtie.rb', line 16

def configuration
  @configuration = nil unless defined?(@configuration)
  @configuration || LOCK.synchronize { @configuration ||= {} }
end

.configure(config_hash = nil) {|configuration| ... } ⇒ Object

Yields:



6
7
8
9
10
11
12
13
# File 'lib/featureflow/rails/railtie.rb', line 6

def configure(config_hash=nil)
  if config_hash
    configuration.merge!(config_hash)
  end

  yield(configuration) if block_given?
  yield(featureflow) if block_given?
end

.featureflowObject

Configuration getters



22
23
24
25
# File 'lib/featureflow/rails/railtie.rb', line 22

def featureflow
  @featureflow = nil unless defined?(@featureflow)
  @featureflow || LOCK.synchronize { @featureflow ||= Featureflow::Client.new(configuration) }
end