Class: JSON::Ext::Parser
- Defined in:
- ext/json/ext/parser/parser.c,
lib/json/ext.rb,
ext/json/ext/parser/parser.c
Overview
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.
Class Method Summary collapse
-
.parse(Vsource, opts) ⇒ Object
Allow redefinition by extensions Allow redefinition by extensions.
Instance Method Summary collapse
-
#initialize(source, opts = nil) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
- #source ⇒ Object
Constructor Details
#initialize(source, opts = nil) ⇒ Parser
Returns a new instance of Parser.
17 18 19 20 |
# File 'lib/json/ext.rb', line 17 def initialize(source, opts = nil) @source = source @config = Config.new(opts) end |
Class Method Details
.parse(Vsource, opts) ⇒ Object
Allow redefinition by extensions Allow redefinition by extensions
2143 2144 2145 |
# File 'ext/json/ext/parser/parser.c', line 2143 def parse(...) new(...).parse end |