Class: Lapis::Minecraft::Versioning::Marshalling::VersionParser
- Inherits:
-
Object
- Object
- Lapis::Minecraft::Versioning::Marshalling::VersionParser
- Defined in:
- lib/lapis/minecraft/versioning/marshalling/version_parser.rb
Overview
TODO:
JSON and structural errors are not detected and handled elegantly.
Reads a version document and generates a Detailed instance.
Instance Method Summary collapse
-
#parse(document, url) ⇒ Detailed
Retrieves detailed information from a version document.
Instance Method Details
#parse(document, url) ⇒ Detailed
Retrieves detailed information from a version document.
26 27 28 29 30 31 32 33 34 |
# File 'lib/lapis/minecraft/versioning/marshalling/version_parser.rb', line 26 def parse(document, url) structure = JSON.parse(document) basic = unmarshal_basic_info(structure, url) asset_index = unmarshal_asset_index(structure['assetIndex']) downloads = unmarshal_downloads(structure['downloads']) libraries = unmarshal_libraries(structure['libraries']) launcher_properties = unmarshal_launcher_properties(structure) Detailed.new(basic, asset_index, downloads, libraries, launcher_properties) end |