diff --git a/ext/json/ext/generator/generator.c b/ext/json/ext/generator/generator.c index 0b7397c56..d686375ea 100644 --- a/ext/json/ext/generator/generator.c +++ b/ext/json/ext/generator/generator.c @@ -1542,7 +1542,7 @@ static VALUE cState_array_nl_set(VALUE self, VALUE array_nl) /* * call-seq: as_json() * - * This string is put at the end of a line that holds a JSON array. + * Returns the callback used to convert unsupported objects in strict mode. */ static VALUE cState_as_json(VALUE self) { @@ -1553,7 +1553,7 @@ static VALUE cState_as_json(VALUE self) /* * call-seq: as_json=(as_json) * - * This string is put at the end of a line that holds a JSON array. + * Sets the Proc used to convert unsupported objects in strict mode. */ static VALUE cState_as_json_set(VALUE self, VALUE as_json) { @@ -1800,8 +1800,7 @@ static VALUE cState_depth(VALUE self) /* * call-seq: depth=(depth) * - * This sets the maximum level of data structure nesting in the generated JSON - * to the integer depth, max_nesting = 0 if no maximum should be checked. + * Sets the current depth of data structure nesting to the integer +depth+. */ static VALUE cState_depth_set(VALUE self, VALUE depth) { diff --git a/lib/json/common.rb b/lib/json/common.rb index 3b5e3157a..5ceb8a2ee 100644 --- a/lib/json/common.rb +++ b/lib/json/common.rb @@ -224,7 +224,7 @@ def detailed_message(...) Fragment = Struct.new(:json) do def initialize(json) unless string = String.try_convert(json) - raise TypeError, " no implicit conversion of #{json.class} into String" + raise TypeError, "no implicit conversion of #{json.class} into String" end super(string)