module RustyJson
RustyJson
is a gem to support [Rust](www.rust-lang.org) development when using JSON. For a deeply nested JSON object, one may create many structs to define the syntax of the expected JSON. RustyJson
merely Aims to reduce that :)
Constants
- VERSION
Public Class Methods
parse(json, name = 'JSON')
click to toggle source
Example Usage:
json = File.read(‘json_file.json’) rust = RustyJson.parse(json)
File.write(‘output_structs.rs’, rust)
In the above example, RustyJson
will parse the JSON in the file: json_file.json and then you print the rust structs out to a Rust File.
@param json [String] the name of the returned struct @param name [String] the JSON to parse @return String
# File lib/rusty_json.rb, line 25 def self.parse(json, name = 'JSON') parser = Parser.new(name, json) parser.parse end