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.
10 11 12 13 14 |
# File 'app/strategies/hyrax/strategies/yaml_strategy.rb', line 10 def initialize(**) @config_file = .delete(:config) yaml_file super(**) end |
Class Method Details
.default_description ⇒ Object
5 6 7 |
# File 'app/strategies/hyrax/strategies/yaml_strategy.rb', line 5 def default_description "Features configured by a YAML configuration file." end |
Instance Method Details
#clear!(_feature) ⇒ Object
27 |
# File 'app/strategies/hyrax/strategies/yaml_strategy.rb', line 27 def clear!(_feature); end |
#enabled?(feature) ⇒ Boolean
20 21 22 23 |
# File 'app/strategies/hyrax/strategies/yaml_strategy.rb', line 20 def enabled?(feature) return unless key_exists?(feature) yaml_file[feature.to_s]["enabled"] end |
#switch!(_feature, _enabled) ⇒ Object
25 |
# File 'app/strategies/hyrax/strategies/yaml_strategy.rb', line 25 def switch!(_feature, _enabled); end |
#switchable? ⇒ Boolean
16 17 18 |
# File 'app/strategies/hyrax/strategies/yaml_strategy.rb', line 16 def switchable? false end |