Class: Sekisyo::Validators::ObjectValidator

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/sekisyo/validators/object_validator.rb

Overview

Sekisyo Validators ObjectValidator is a validator that accepts only hash value.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, properties = {}) ⇒ ObjectValidator

Returns a new instance of ObjectValidator.



12
13
14
15
# File 'lib/sekisyo/validators/object_validator.rb', line 12

def initialize(key, properties = {})
  @key = key
  @properties = Sekisyo::WhitelistDetails::Properties.new(properties)
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



17
18
19
# File 'lib/sekisyo/validators/object_validator.rb', line 17

def key
  @key
end

Instance Method Details

#valid?(value) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/sekisyo/validators/object_validator.rb', line 19

def valid?(value)
  @properties.valid?(value)
end