class JSON::Ext::Parser - Documentation for Ruby 4.0
Description: class JSON::Ext::Parser: This is the JSON parser implemented as a C extension. It can be configured to be used by setting JSON.
Keywords: ruby,class,JSON::Ext::Parser

🔍

No recent searches

# class JSON::Ext::Parser

This is the `JSON` parser implemented as a C extension. It can be configured to be used by setting

    JSON.parser = JSON::Ext::Parser

with the method parser= in `JSON`.

### Constants

Config

### Public Class Methods

new (source, opts = nil)
Source

    # File ext/json/lib/json/ext.rb, line 17
    def initialize(source, opts = nil)
      @source = source
      @config = Config.new(opts)
    end

parse (...)
Source

    # File ext/json/lib/json/ext.rb, line 11
    def parse(...)
      new(...).parse
    end

Also aliased as: parse

### Public Instance Methods

parse ()
Source

    # File ext/json/lib/json/ext.rb, line 26
    def parse
      @config.parse(@source)
    end

source ()
Source

    # File ext/json/lib/json/ext.rb, line 22
    def source
      @source.dup
    end