Module: RbJSON5
- Defined in:
- lib/rb_json5.rb,
lib/rb_json5/parser.rb,
lib/rb_json5/version.rb,
lib/rb_json5/parse_error.rb,
lib/rb_json5/parser/misc.rb,
lib/rb_json5/parser/null.rb,
lib/rb_json5/parser/array.rb,
lib/rb_json5/parser/space.rb,
lib/rb_json5/parser/number.rb,
lib/rb_json5/parser/object.rb,
lib/rb_json5/parser/string.rb,
lib/rb_json5/parser/boolean.rb,
lib/rb_json5/escape_sequence.rb
Overview
JSON5 parser for Ruby
Defined Under Namespace
Classes: EscapeSequence, ParseError, Parser
Constant Summary collapse
- VERSION =
Current version of RbJSON5
'0.3.0'
Class Method Summary collapse
-
.load_file(filename, symbolize_names: false) ⇒ Object
Reads a JSON5 string from the given file and parses it into its Ruby data structure.
-
.parse(string_or_io, symbolize_names: false) ⇒ Object
Parses a JSON5 string into its Ruby data structure.
Class Method Details
.load_file(filename, symbolize_names: false) ⇒ Object
Reads a JSON5 string from the given file and parses it into its Ruby data structure
43 44 45 |
# File 'lib/rb_json5.rb', line 43 def self.load_file(filename, symbolize_names: false) File.open(filename, 'r') { |io| parse(io, symbolize_names: symbolize_names) } end |