Sha256: e97fcd4dd652b11f23817bfb463e4f9aa0b69588dc85c292a9efbfef610d0ea2

Contents?: true

Size: 592 Bytes

Versions: 17

Compression:

Stored size: 592 Bytes

Contents

module FeatureState

  def feature_broken!(feature_name)
    set_feature_state! feature_name, "broken"
  end

  def feature_working!(feature_name)
    set_feature_state! feature_name, "working"
  end

  def feature_state(feature_name)
    feature_states[feature_name.to_s]
  end

  def broken_features(*features)
    features.flatten.select { |feature_name| feature_state(feature_name) == "broken" }
  end

  def feature_states
    super || {}
  end

  def set_feature_state!(feature_name, state)
    update_column :feature_states, feature_states.merge(feature_name.to_s => state)
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
houston-core-0.8.0.pre app/concerns/feature_state.rb
houston-core-0.7.0 app/concerns/feature_state.rb
houston-core-0.7.0.beta4 app/concerns/feature_state.rb
houston-core-0.7.0.beta3 app/concerns/feature_state.rb
houston-core-0.7.0.beta2 app/concerns/feature_state.rb
houston-core-0.7.0.beta app/concerns/feature_state.rb
houston-core-0.6.3 app/concerns/feature_state.rb
houston-core-0.6.2 app/concerns/feature_state.rb
houston-core-0.6.1 app/concerns/feature_state.rb
houston-core-0.6.0 app/concerns/feature_state.rb
houston-core-0.5.6 app/concerns/feature_state.rb
houston-core-0.5.5 app/concerns/feature_state.rb
houston-core-0.5.4 app/concerns/feature_state.rb
houston-core-0.5.3 app/concerns/feature_state.rb
houston-core-0.5.2 app/concerns/feature_state.rb
houston-core-0.5.1 app/concerns/feature_state.rb
houston-core-0.5.0 app/concerns/feature_state.rb