Issue #11300 has been updated by Yukihiro Matsumoto.

Status changed from Open to Feedback

Two points. Unlike #hex and #oct, there's little demand for 0/1 strings conversion.
Besides that, String#bin can be easily confused with "binary (raw) encoding" and cause more surprise.
Any opinion?

Matz.


----------------------------------------
Bug #11300: [PATCH] Add String#bin for parity with #hex and #oct.
https://bugs.ruby-lang.org/issues/11300#change-53098

* Author: D.E. Akers
* Status: Feedback
* Priority: Normal
* Assignee: 
* ruby -v: 
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
## Proposal

It is proposed that `String#bin` be added to return the receiver's value when interpreted as a string of binary digits.

## Rationale

This method's absence is surprising in the presence of `#hex` and `#oct`.

---Files--------------------------------
string_bin.patch (2.17 KB)


-- 
https://bugs.ruby-lang.org/