Class: Stix2::Validators::Hashes
- Inherits:
-
Object
- Object
- Stix2::Validators::Hashes
- Defined in:
- lib/stix2/validators/hashes.rb
Instance Method Summary collapse
-
#initialize(hsh) ⇒ Hashes
constructor
A new instance of Hashes.
Constructor Details
#initialize(hsh) ⇒ Hashes
Returns a new instance of Hashes.
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 |