Project

General

Profile

Actions

Feature #20469

closed

Add a JSON addition for Enumerator::ArithmeticSequence

Added by shan (Shannon Skipper) 15 days ago. Updated 10 days 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.

Updated by shan (Shannon Skipper) 14 days ago

I just realized I filed my PR in the wrong place since JSON is a gem. (Sorry for the noise.) I closed the previous PR and opened one in the JSON gem repo. https://github.com/flori/json/pull/583

Actions #2

Updated by hsbt (Hiroshi SHIBATA) 10 days ago

  • Status changed from Open to Third Party's Issue
Actions

Also available in: Atom PDF

Like0
Like0Like0