I'm not sure if this is a bug or not but there seems to be some inconsistency in creating a rational from nil. Rational(nil) # => TypeError: can't convert nil into Rational nil.to_r # => (1/0) I would think that the latter would p...kyledecot (Kyle Decot)
When refining a class (such as `String` in the following example) it is impossible to assign a constant. The constant will get attached to the module containing the refinement instead of the refined class. When inside of a `refine` bloc...kyledecot (Kyle Decot)
Again, I understand that `grep` can do this but I feel that (especially in my reject example) that the intent is much clearer w/ my proposed addition. What would be the downside to adding something like this to select/reject (or Enumbera...kyledecot (Kyle Decot)
=begin Yes, grep would be a suitable alternative for `select` w/ a regex in this instance. What about for `reject` though? I feel that %w[foo bar baz].reject /^ba/ # ["foo"] Is more readable than %w[foo bar baz].grep /^...kyledecot (Kyle Decot)
It would be handy if `select` could accept a regex. For example ```ruby %w[foo bar baz].select(/^ba/) # => ["bar", "baz"] ``` This is currently possible via the slightly longer syntax ```ruby %w[foo bar baz].select{|i| i[/^b...kyledecot (Kyle Decot)
(Sorry for the duplicate post, this one can be deleted) kyledecot (Kyle Decot) wrote: > I understand that it's a dangerous operation but how does naming it inconsistently make any less so other than making it difficult to find in the do...kyledecot (Kyle Decot)
I understand that it's a dangerous operation but how does naming it inconsistently make any less so other than making it difficult to find in the documentation? The fact that it's a private method I would think should be protection enoug...kyledecot (Kyle Decot)