I saw such a proposal before and I thought of some syntax and implementation, but I didn't submit that in the previous issue: ```ruby class MethodNegator < BasicObject def initialize(obj) @obj = obj end def method_mis...hmdne (hmdne -)
In particular, Delegator works in an interesting way by: 1. Inheriting from BasicObject 2. Duping the Kernel module (as k) 3. Undefining some methods from k 4. Including k So, for this particular purpose, moving methods from Ker...hmdne (hmdne -)
kwargs are... complicated. Let me first extend the issue with additional versions of the above (I run Ruby 3.1, but from what I know, everything applies to anything >= Ruby 3.0): ```ruby [1] pry(main)> method(def a(a:, b:); end).arity =...hmdne (hmdne -)
I like it, though one while reading that code could have a problem with attempting to find a `where` variable. Perhaps a more clearer way to write this would be the following: ``` records.=where.not(id: excluded_ids) if some_condi...hmdne (hmdne -)
I had another idea regarding a #non method that I haven't voiced before, but may result in cleaner code overall: ```ruby class Negator < ::BasicObject def initialize(obj) @object = obj end def method_missing(...) ...hmdne (hmdne -)
@sawa - My proposal would be to allow omitting parentheses only if there are no arguments provided, ie. how it is currently. ```ruby self.xyz = 6 # correct currently self.xyz() = 6 # correct under the proposal self.xyz(a) = 6 # cor...hmdne (hmdne -)
I propose here to allow a syntax like: ```ruby obj.method(arg) = value ``` It would be translated to the following: ```ruby obj.__send__(:method=, arg, value) ``` The lack of this syntax kind of limits the ability to desi...hmdne (hmdne -)
> `# looking into global value isn't exactly elegant, right?` It's not global, it's Fiber-local, so are $1 and friends. This may not be messaged well enough in the documentation though... ```ruby [1] pry(main)> z = Fiber.new { /(....hmdne (hmdne -)
Hm, came into my mind that you may prefer to use this, more readable snippet instead: ```ruby raise ArgumentError unless [bar, baz].one? ```hmdne (hmdne -)
Since we don't need short-circuit evaluation, we can simply use `^` for that reason. It's already defined on both TrueClass and FalseClass AND NilClass. @indirect your example can be written as follows: ```ruby raise ArgumentE...hmdne (hmdne -)