lib/pulse_meter/mixins/utils.rb
# Ensures that hash value specified by key is Array
# @param options [Hash] hash to be looked at
# @param key [Object] hash key
# @param default [Object] default value to be returned
# @raise [ArgumentError] unless value is Array
# @return [Array]
Ensures that hash value specified by key is Array
Ensures that hash value specified by key is Array
def assert_array!(options, key, default = nil)
        value = options[key] || default
        raise ArgumentError, "#{key} should be defined" unless value
        raise ArgumentError, "#{key} should be array" unless value.is_a?(Array)
        value
      end
def assert_array! ( options , key , default = nil ) value = options [ key ] || default raise ArgumentError , "#{key} should be defined" unless value raise ArgumentError , "#{key} should be array" unless value . is_a? ( Array ) value end
Ensures that hash value specified by key is Array
Ensures that hash value specified by key is Array
None
Array
[ArgumentError] unless value is Array
[ ArgumentError ] unless value is Array
options
hash to be looked at
hash to be looked at
key
None
default
default value to be returned
default value to be returned