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.
77 78 79 80 |
# File 'lib/oj/json.rb', line 77 def initialize(src) raise TypeError.new("already initialized") unless @source.nil? @source = src end |
Instance Method Details
#parse ⇒ Object
87 88 89 90 |
# File 'lib/oj/json.rb', line 87 def parse() raise TypeError.new("already initialized") if @source.nil? JSON.parse(@source) end |
#source ⇒ Object
82 83 84 85 |
# File 'lib/oj/json.rb', line 82 def source() raise TypeError.new("already initialized") if @source.nil? @source end |