1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[flori/json] Pass args all #to_json in json/add/*.

https://github.com/flori/json/commit/36a7ef6790
This commit is contained in:
Sho Hashimoto 2019-01-15 22:16:05 +09:00 committed by Nobuyoshi Nakada
parent 7376d70cb0
commit d9e50fcbeb
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
4 changed files with 8 additions and 8 deletions

View file

@ -23,7 +23,7 @@ class BigDecimal
end end
# return the JSON value # return the JSON value
def to_json(*) def to_json(*args)
as_json.to_json as_json.to_json(*args)
end end
end end

View file

@ -23,7 +23,7 @@ class Complex
end end
# Stores class name (Complex) along with real value <tt>r</tt> and imaginary value <tt>i</tt> as JSON string # Stores class name (Complex) along with real value <tt>r</tt> and imaginary value <tt>i</tt> as JSON string
def to_json(*) def to_json(*args)
as_json.to_json as_json.to_json(*args)
end end
end end

View file

@ -22,7 +22,7 @@ class Rational
end end
# Stores class name (Rational) along with numerator value <tt>n</tt> and denominator value <tt>d</tt> as JSON string # Stores class name (Rational) along with numerator value <tt>n</tt> and denominator value <tt>d</tt> as JSON string
def to_json(*) def to_json(*args)
as_json.to_json as_json.to_json(*args)
end end
end end

View file

@ -24,7 +24,7 @@ class Regexp
# Stores class name (Regexp) with options <tt>o</tt> and source <tt>s</tt> # Stores class name (Regexp) with options <tt>o</tt> and source <tt>s</tt>
# (Regexp or String) as JSON string # (Regexp or String) as JSON string
def to_json(*) def to_json(*args)
as_json.to_json as_json.to_json(*args)
end end
end end