Class: JSONC::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/jsonc/parser.rb,
lib/jsonc/parser/comment_remover.rb,
lib/jsonc/parser/trailing_comma_remover.rb

Overview

The main parser class. It orchestrates the removal of comments and trailing commas.

Defined Under Namespace

Classes: CommentRemover, TrailingCommaRemover

Class Method Summary collapse

Class Method Details

.parse(string) ⇒ Object



9
10
11
12
# File 'lib/jsonc/parser.rb', line 9

def self.parse(string)
  comment_free_string = CommentRemover.new(string).parse
  TrailingCommaRemover.new(comment_free_string).parse
end