Class: StructuredReader::JSONReader::ValidatorContext
- Inherits:
-
Object
- Object
- StructuredReader::JSONReader::ValidatorContext
- Defined in:
- lib/structured_reader.rb
Instance Method Summary collapse
- #accept(fragment) ⇒ Object
- #flunk(fragment, reason) ⇒ Object
-
#initialize(where = "", errors = []) ⇒ ValidatorContext
constructor
A new instance of ValidatorContext.
- #push(path) {|self.class.new(@where + path, @errors)| ... } ⇒ Object
Constructor Details
#initialize(where = "", errors = []) ⇒ ValidatorContext
Returns a new instance of ValidatorContext.
335 336 337 338 |
# File 'lib/structured_reader.rb', line 335 def initialize(where = "", errors = []) @where = where.dup.freeze @errors = errors end |
Instance Method Details
#accept(fragment) ⇒ Object
340 341 342 |
# File 'lib/structured_reader.rb', line 340 def accept(fragment) @errors end |
#flunk(fragment, reason) ⇒ Object
344 345 346 |
# File 'lib/structured_reader.rb', line 344 def flunk(fragment, reason) @errors << [@where, reason] end |
#push(path) {|self.class.new(@where + path, @errors)| ... } ⇒ Object
348 349 350 |
# File 'lib/structured_reader.rb', line 348 def push(path) yield self.class.new(@where + path, @errors) end |