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:
parent
7376d70cb0
commit
d9e50fcbeb
4 changed files with 8 additions and 8 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue