lib/ecraft/extensions/bigdecimal.rb in ecraft-extensions-0.3.1 vs lib/ecraft/extensions/bigdecimal.rb in ecraft-extensions-0.4.0
- old
+ new
@@ -21,24 +21,24 @@
# Converts this object to JSON form, in the simplest string form possible, either looking like a `Float` or `Fixnum`.
#
# Values without any fraction digits will use `Fixnum` form, where values with a fractional part will use `Float` form.
#
# @return [String]
- def to_json(*_a)
+ def to_json(*_args)
to_s
end
# Converts this object to the simplest string form possible, either looking like a `Float` or `Fixnum`.
#
# Values without any fraction digits will use `Fixnum` form, where values with a fractional part will use `Float` form.
#
- # @param s [String] The format that should be used for the conversion. If provided, the original `to_s` implementation will be
- # called using this parameter to provide the same semantics as the original method.
+ # @param string_format [String] The format that should be used for the conversion. If provided, the original `to_s`
+ # implementation will be called using this parameter to provide the same semantics as the original method.
# @return [String]
- def to_s(s = nil)
- if s.nil?
+ def to_s(string_format = nil)
+ if string_format.nil?
to_s_original('F').gsub(/\.0$/, '')
else
- to_s_original(s)
+ to_s_original(string_format)
end
end
end