Class: Stix2::Validators::Hashes

Inherits:
Object
  • Object
show all
Defined in:
lib/stix2/validators/hashes.rb

Instance Method Summary collapse

Constructor Details

#initialize(hsh) ⇒ Hashes

Returns a new instance of Hashes.

Raises:

  • (ArgumentError)


4
5
6
7
8
# File 'lib/stix2/validators/hashes.rb', line 4

def initialize(hsh)
  return if !hsh
  raise(ArgumentError.new("hash argument must be an actual hash. Got: #{hsh.class}")) if !hsh.is_a?(::Hash)
  Stix2::Validators::Array.new(hsh.keys, Stix2::HASH_ALGORITHM_OV)
end