From 2edd8d0a2360477387d603dfab80acdda5372f78 Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Thu, 16 Nov 2023 15:46:01 -0600 Subject: [PATCH] [DOC] Add section Methods for Working with JSON --- ext/bigdecimal/bigdecimal.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 07c2bcf0..d73e0714 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -4363,7 +4363,20 @@ BigDecimal_negative_zero(void) * (2/3r).to_d(3) # => 0.667e0 * "0.5".to_d # => 0.5e0 * - * == License + * == Methods for Working with \JSON + * + * - {::json_create}[https://docs.ruby-lang.org/en/master/BigDecimal.html#method-c-json_create]: + * Returns a new \BigDecimal object constructed from the given object. + * - {#as_json}[https://docs.ruby-lang.org/en/master/BigDecimal.html#method-i-as_json]: + * Returns a 2-element hash representing +self+. + * - {#to_json}[https://docs.ruby-lang.org/en/master/BigDecimal.html#method-i-to_json]: + * Returns a \JSON string representing +self+. + * + * To make these methods available: + * + * require 'json/add/bigdecimal' + * + * * == License * * Copyright (C) 2002 by Shigeo Kobayashi . *