Class: JSON::Ext::Parser
- Inherits:
-
Object
- Object
- JSON::Ext::Parser
- Defined in:
- ext/oj/mimic_json.c,
lib/oj/json.rb
Overview
The JSON::Ext::Parser is a placeholder in the mimic JSON module used for compatibility only.
Instance Method Summary collapse
-
#initialize(src) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
- #source ⇒ Object
Constructor Details
#initialize(src) ⇒ Parser
Returns a new instance of Parser.
84 85 86 87 88 |
# File 'lib/oj/json.rb', line 84 def initialize(src) raise TypeError.new("already initialized") unless @source.nil? @source = src end |
Instance Method Details
#parse ⇒ Object
96 97 98 99 100 |
# File 'lib/oj/json.rb', line 96 def parse() raise TypeError.new("already initialized") if @source.nil? JSON.parse(@source) end |
#source ⇒ Object
90 91 92 93 94 |
# File 'lib/oj/json.rb', line 90 def source() raise TypeError.new("already initialized") if @source.nil? @source end |