Project

General

Profile

Actions

Feature #20469

closed

Add a JSON addition for Enumerator::ArithmeticSequence

Added by shan (Shannon Skipper) about 2 months ago. Updated about 1 month ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
[ruby-core:117764]

Description

There's a JSON addition for Range but one wasn't added for Enumerator::ArithmeticSequence when it was introduced. This little PR adds a JSON addition for ArithmeticSequence for parity with a normal Range. https://github.com/ruby/ruby/pull/10720/files

##
# Already supported
require 'json/add/range'
(0..42).to_json

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

I was curious about adding it to add/core.rb but it seems like that could be considered separately, especially since there are classes like Set that could also be considered for inclusion now that it's a core class.

Actions

Also available in: Atom PDF

Like0
Like0Like0