Sha256: 3b9479b0d69bfcd1a82242d3f8b53969c0dc794c9506f17b215c3d78bf0957dd

Contents?: true

Size: 1.06 KB

Versions: 5

Compression:

Stored size: 1.06 KB

Contents

class Object
  raise 'Abstract feature branch conflicts with another Ruby library' if respond_to?(:feature_branch)
  def self.feature_branch(feature_name, branches = {}, &feature_work)
    branches[:true] ||= feature_work
    branches[:false] ||= lambda {}
    feature_branch_symbol_value = (!!feature_enabled?(feature_name)).to_s.to_sym
    branches[feature_branch_symbol_value].call
  end

  raise 'Abstract feature branch conflicts with another Ruby library' if respond_to?(:feature_enabled?)
  def self.feature_enabled?(feature_name)
    AbstractFeatureBranch.application_features[feature_name.to_s.downcase]
  end

  raise 'Abstract feature branch conflicts with another Ruby library' if Object.new.respond_to?(:feature_branch)
  def feature_branch(feature_name, branches = {}, &feature_work)
    Object.feature_branch(feature_name.to_s, branches, &feature_work)
  end

  raise 'Abstract feature branch conflicts with another Ruby library' if Object.new.respond_to?(:feature_enabled?)
  def feature_enabled?(feature_name)
    Object.feature_enabled?(feature_name.to_s)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
abstract_feature_branch-1.0.0 lib/ext/feature_branch.rb
abstract_feature_branch-0.9.0 lib/ext/feature_branch.rb
abstract_feature_branch-0.8.0 lib/ext/feature_branch.rb
abstract_feature_branch-0.7.1 lib/ext/feature_branch.rb
abstract_feature_branch-0.7.0 lib/ext/feature_branch.rb