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.



10
11
12
13
14
# File 'app/strategies/hyrax/strategies/yaml_strategy.rb', line 10

def initialize(**options)
  @config_file = options.delete(:config)
  yaml_file
  super(**options)
end

Class Method Details

.default_descriptionObject



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

Returns:

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

Returns:

  • (Boolean)


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

def switchable?
  false
end