ruby / stringio

Pseudo `IO` class from/to `String`.
BSD 2-Clause "Simplified" License
33 stars 26 forks source link

Alias #string to #to_s/#to_str #103

Closed sebyx07 closed 2 weeks ago

sebyx07 commented 4 weeks ago

fix GH-102

imo, a lot of users would rather call buffer.to_s instead of the .string method, nobody atm depends on the .to_s. There already is .inspect that behaves like the current to_s

bonus, having .to_s, now you can interpolate string io into strings w/o calling .to_s

nobu commented 3 weeks ago

StringIO is an IO-like class but not a String-compatible class, so StringIO#to_str is not acceptable.

sebyx07 commented 2 weeks ago

@nobu - but #to_s is fine?