Class: Hyrax::Strategies::YamlStrategy

Inherits:
Flipflop::Strategies::AbstractStrategy
  • Object
show all
Defined in:
app/strategies/hyrax/strategies/yaml_strategy.rb

Class Method Summary collapse

Instance Method Summary collapse

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(**options)
  @config_file = options.delete(:config)
  yaml_file
  super(**options)
end

Class Method Details

.default_descriptionObject



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

Returns:

  • (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

Returns:

  • (Boolean)


15
16
17
# File 'app/strategies/hyrax/strategies/yaml_strategy.rb', line 15

def switchable?
  false
end