Module: Jade::Decode::Runner
Instance Method Summary collapse
Instance Method Details
#from_json(decoder, json_string) ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/jade/decode.rb', line 40 def from_json(decoder, json_string) begin parsed = JSON.parse(json_string) rescue JSON::ParserError => e return err(Jade::Decode::WrongType["valid JSON", e.]) end run(decoder, parsed) end |
#run(decoder, value) ⇒ Object
49 50 51 |
# File 'lib/jade/decode.rb', line 49 def run(decoder, value) interp(decoder.desc, value) end |