Class: EasyJSONMatcher::Node
- Inherits:
-
Object
- Object
- EasyJSONMatcher::Node
- Defined in:
- lib/easy_json_matcher/node.rb
Instance Attribute Summary collapse
-
#node_validator ⇒ Object
readonly
Returns the value of attribute node_validator.
Instance Method Summary collapse
- #call(value:) ⇒ Object
-
#initialize(opts: [], strict: false, validators:, **args) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(opts: [], strict: false, validators:, **args) ⇒ Node
Returns a new instance of Node.
7 8 9 10 11 12 |
# File 'lib/easy_json_matcher/node.rb', line 7 def initialize(opts: [], strict: false, validators:, **args) super(**args) @node_validator = chain_factory.get_chain(steps: opts + [:object]) validators = node_content_validator.new(validators: validators, strict: strict) @node_validator.concat(validators) end |
Instance Attribute Details
#node_validator ⇒ Object (readonly)
Returns the value of attribute node_validator.
5 6 7 |
# File 'lib/easy_json_matcher/node.rb', line 5 def node_validator @node_validator end |
Instance Method Details
#call(value:) ⇒ Object
14 15 16 |
# File 'lib/easy_json_matcher/node.rb', line 14 def call(value:) node_validator.call(value: value) end |