# See the License for the specific language governing permissions and
# limitations under the License.
- # Dynamic interface to read Json strings.
+ # Dynamic interface to read JSON strings.
#
# `String::to_json_value` returns a `JsonValue` which can be queried
- # to get the underlying Json data. It can also be used as any Json types.
+ # to get the underlying JSON data.
module dynamic
import error
private import static
+ # Wraps a JSON value.
+ #
+ # Offer methods to query the type, to dynamicaly cast the underlying value and
+ # to query elements (in case of a JSON object or a JSON array).
+ #
+ # Use `String::to_json_value` to get a `JsonValue` from a string.
class JsonValue
+
+ # The wrapped JSON value.
var value: nullable Object
# Is this value null?
#
# require: `self.is_numeric`
#
- # assert "1.234".to_json_value.to_numeric = 1.234
- # assert "1234".to_json_value.to_numeric = 1234
+ # assert "1.234".to_json_value.to_numeric == 1.234
+ # assert "1234".to_json_value.to_numeric == 1234
fun to_numeric: Numeric
do
if is_int then return to_i