Class: ToonFormat::Decoder
- Inherits:
-
Object
- Object
- ToonFormat::Decoder
- Defined in:
- lib/toon_format/decoder.rb
Overview
Decodes TOON format strings to Ruby objects
Constant Summary collapse
- MAX_INPUT_SIZE =
10 MB
10 * 1024 * 1024
Class Method Summary collapse
-
.decode(toon_string, strict: true) ⇒ Object
Decode TOON format string to Ruby object.
Class Method Details
.decode(toon_string, strict: true) ⇒ Object
Decode TOON format string to Ruby object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/toon_format/decoder.rb', line 13 def self.decode(toon_string, strict: true) validate_input(toon_string) parser = Parser.new(toon_string, strict: strict) data = parser.parse Validator.validate!(toon_string, data) if strict data end |