Class: Sekisyo::Validators::ObjectValidator
- Inherits:
-
Object
- Object
- Sekisyo::Validators::ObjectValidator
- 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
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
-
#initialize(key, properties = {}) ⇒ ObjectValidator
constructor
A new instance of ObjectValidator.
- #valid?(value) ⇒ Boolean
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
#key ⇒ Object (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
19 20 21 |
# File 'lib/sekisyo/validators/object_validator.rb', line 19 def valid?(value) @properties.valid?(value) end |