Method: Utilities#required_option
- Defined in:
- lib/utilities.rb
#required_option(options, key) ⇒ Object
Throws an error if an option is missing
great for checking if properties exist
Attributes
-
options- the options hash -
key- key to find
149 150 151 152 153 |
# File 'lib/utilities.rb', line 149 def required_option(, key) result = get_option(, key) raise ArgumentError, "Missing required option: #{key}" if result == "" result end |