Skip to content

Commit 36a7ef6

Browse files
sho-hflori
authored andcommitted
Pass args all #to_json in json/add/*.
1 parent 09aa02e commit 36a7ef6

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

lib/json/add/bigdecimal.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def as_json(*)
2323
end
2424

2525
# return the JSON value
26-
def to_json(*)
27-
as_json.to_json
26+
def to_json(*args)
27+
as_json.to_json(*args)
2828
end
2929
end

lib/json/add/complex.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def as_json(*)
2323
end
2424

2525
# Stores class name (Complex) along with real value <tt>r</tt> and imaginary value <tt>i</tt> as JSON string
26-
def to_json(*)
27-
as_json.to_json
26+
def to_json(*args)
27+
as_json.to_json(*args)
2828
end
2929
end

lib/json/add/rational.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def as_json(*)
2222
end
2323

2424
# Stores class name (Rational) along with numerator value <tt>n</tt> and denominator value <tt>d</tt> as JSON string
25-
def to_json(*)
26-
as_json.to_json
25+
def to_json(*args)
26+
as_json.to_json(*args)
2727
end
2828
end

lib/json/add/regexp.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def as_json(*)
2424

2525
# Stores class name (Regexp) with options <tt>o</tt> and source <tt>s</tt>
2626
# (Regexp or String) as JSON string
27-
def to_json(*)
28-
as_json.to_json
27+
def to_json(*args)
28+
as_json.to_json(*args)
2929
end
3030
end

0 commit comments

Comments
 (0)