Method: Pcli::Util::Hash.require_presence
- Defined in:
- lib/pcli/util/hash.rb
.require_presence(hash, key, message = nil) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/pcli/util/hash.rb', line 13 def self.require_presence(hash, key, = nil) ||= "The key \"#{key}\" must be present in the hash #{hash}" raise unless hash.key?(key) hash[key] end |