Class: Hyrax::Strategies::YamlStrategy
- Inherits:
-
Flipflop::Strategies::AbstractStrategy
- Object
- Flipflop::Strategies::AbstractStrategy
- Hyrax::Strategies::YamlStrategy
- Defined in:
- app/strategies/hyrax/strategies/yaml_strategy.rb
Class Method Summary collapse
Instance Method Summary collapse
- #clear!(_feature) ⇒ Object
- #enabled?(feature) ⇒ Boolean
-
#initialize(**options) ⇒ YamlStrategy
constructor
A new instance of YamlStrategy.
- #switch!(_feature, _enabled) ⇒ Object
- #switchable? ⇒ Boolean
Constructor Details
#initialize(**options) ⇒ YamlStrategy
Returns a new instance of YamlStrategy.
9 10 11 12 13 |
# File 'app/strategies/hyrax/strategies/yaml_strategy.rb', line 9 def initialize(**) @config_file = .delete(:config) yaml_file super(**) end |
Class Method Details
.default_description ⇒ Object
4 5 6 |
# File 'app/strategies/hyrax/strategies/yaml_strategy.rb', line 4 def default_description "Features configured by a YAML configuration file." end |
Instance Method Details
#clear!(_feature) ⇒ Object
26 |
# File 'app/strategies/hyrax/strategies/yaml_strategy.rb', line 26 def clear!(_feature); end |
#enabled?(feature) ⇒ Boolean
19 20 21 22 |
# File 'app/strategies/hyrax/strategies/yaml_strategy.rb', line 19 def enabled?(feature) return unless key_exists?(feature) yaml_file[feature.to_s]["enabled"] end |
#switch!(_feature, _enabled) ⇒ Object
24 |
# File 'app/strategies/hyrax/strategies/yaml_strategy.rb', line 24 def switch!(_feature, _enabled); end |
#switchable? ⇒ Boolean
15 16 17 |
# File 'app/strategies/hyrax/strategies/yaml_strategy.rb', line 15 def switchable? false end |