ruby / json

JSON implementation for Ruby
https://ruby.github.io/json
Other
673 stars 326 forks source link

Add a JSON addition for `Enumerator::ArithmeticSequence` #583

Open havenwood opened 5 months ago

havenwood commented 5 months ago

This PR adds a JSON addition for Enumerator::ArithmeticSequence since it was added to the Ruby stdlib.

##
# Existing Range support
require 'json/add/range'
(0..42).to_json

##
# Proposed Enumerator::ArithmeticSequence addition
require 'json/add/arithmetic_sequence'
((0..42) % 3).to_json

I forgot JSON was a gem yesterday and made a PR to Ruby and filed feature request. I realized my mistake this morning, and opened this PR. 🙂