class StructuredReader::JSONReader::Context

Public Class Methods

new(where = "") click to toggle source
# File lib/structured_reader.rb, line 324
def initialize(where = "")
  @where = where.dup.freeze
end

Public Instance Methods

accept(fragment) click to toggle source
# File lib/structured_reader.rb, line 328
def accept(fragment)
  fragment
end
flunk(fragment, reason) click to toggle source
# File lib/structured_reader.rb, line 336
def flunk(fragment, reason)
  raise WrongTypeError, "#{reason}, got a #{fragment.class} (at #{@where})"
end
open(&blk) click to toggle source
# File lib/structured_reader.rb, line 332
def open(&blk)
  blk.call(self)
end
push(path) { |class.new(where + path)| ... } click to toggle source
# File lib/structured_reader.rb, line 340
def push(path, &blk)
  yield self.class.new(@where + path)
end