Sha256: 11f1cded5138e29f941e6267620eedc9c8b5b4e496a920fb68ddc6233de8faf0

Contents?: true

Size: 304 Bytes

Versions: 2

Compression:

Stored size: 304 Bytes

Contents

# frozen_string_literal: true

class Serega
  class CheckOptIsHash
    def self.call(opts, key)
      return unless opts.key?(key)

      value = opts[key]
      return if value.is_a?(Hash)

      raise Error, "Invalid option #{key.inspect} => #{value.inspect}. Must have a Hash value"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
serega-0.1.1 lib/serega/validations/check_opt_is_hash.rb
serega-0.1.0 lib/serega/validations/check_opt_is_hash.rb