Method: Qa::LinkedData::Config::Helper.fetch_boolean

Defined in:
app/models/qa/linked_data/config/helper.rb

.fetch_boolean(map, key, default) ⇒ Object

Fetch a boolean value from a hash map throwing an exception if the value is not boolean



12
13
14
15
16
# File 'app/models/qa/linked_data/config/helper.rb', line 12

def self.fetch_boolean(map, key, default)
  value = map.fetch(key, default)
  raise Qa::InvalidConfiguration, "#{key} must be true or false" unless value == true || value == false
  value
end