Class: Xpect::Keys
- Inherits:
-
Object
- Object
- Xpect::Keys
- Defined in:
- lib/xpect/keys.rb
Instance Method Summary collapse
- #conform!(value:, path: []) ⇒ Object
-
#initialize(required: {}, optional: {}) ⇒ Keys
constructor
A new instance of Keys.
Constructor Details
#initialize(required: {}, optional: {}) ⇒ Keys
Returns a new instance of Keys.
3 4 5 6 7 8 |
# File 'lib/xpect/keys.rb', line 3 def initialize(required: {}, optional: {}) raise "required must be a Hash" unless required.is_a?(Hash) && optional.is_a?(Hash) @optional = optional @required = required end |
Instance Method Details
#conform!(value:, path: []) ⇒ Object
10 11 12 13 |
# File 'lib/xpect/keys.rb', line 10 def conform!(value:, path: []) required = process_required(value, path) process_optional(required, value, path) end |