class Range
def to_json(*args)
{"json_class":"Range","a":["a","d",false]}
{"json_class":"Range","a":[1,4,true]}
{"json_class":"Range","a":[1,4,false]}
Output:
puts ('a'..'d').to_json
puts (1...4).to_json
puts (1..4).to_json
require 'json/add/range'
Returns a JSON string representing +self+:
def to_json(*args) as_json.to_json(*args) end