You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Note: Float is handled this way since Float#to_s is slow anyway
369
375
buf << obj.to_json(self)
@@ -539,10 +545,10 @@ def json_transform(state)
539
545
each{ |value|
540
546
result << delimunlessfirst
541
547
result << state.indent * depthifindent
542
-
ifstate.strict? && !(false == value || true == value || nil == value || String === value || Array === value || Hash === value || Integer === value || Float === value || Fragment === value)
548
+
ifstate.strict? && !(false == value || true == value || nil == value || String === value || Array === value || Hash === value || Integer === value || Float === value || Fragment === value || Symbol == value)
543
549
ifstate.as_json
544
550
value=state.as_json.call(value)
545
-
unlessfalse == value || true == value || nil == value || String === value || Array === value || Hash === value || Integer === value || Float === value || Fragment === value
551
+
unlessfalse == value || true == value || nil == value || String === value || Array === value || Hash === value || Integer === value || Float === value || Fragment === value || Symbol === value
546
552
raiseGeneratorError.new("#{value.class} returned by #{state.as_json} not allowed in JSON",value)
547
553
end
548
554
result << value.to_json(state)
@@ -591,6 +597,17 @@ def to_json(state = nil, *)
591
597
end
592
598
end
593
599
600
+
moduleSymbol
601
+
defto_json(state=nil, *args)
602
+
state=State.from_state(state)
603
+
ifstate.strict?
604
+
name.to_json(state, *args)
605
+
else
606
+
super
607
+
end
608
+
end
609
+
end
610
+
594
611
moduleString
595
612
# This string should be encoded with UTF-8 A call to this method
596
613
# returns a JSON string encoded with UTF16 big endian characters as
0 commit comments