Oh, thank you.

One more question, do you consider add support for `present?`,  i wrote 
code like this at the end of that file.

```
[FalseClass, Object, NilClass, Numeric, String, TrueClass].each do |klass|
  # :nocov:
  klass.define_method(:present?) { !blank? }
  # :nocov:
end
```
在2021年8月4日星期三 UTC+8 下午10:43:17<Jeremy Evans> 写道:

> On Wed, Aug 4, 2021 at 7:35 AM Billy Zheng <[email protected]> wrote:
>
>> I write a gem use the code from `sequel/extensions/blank`, when i reading 
>> following code, i don't understand why we need run `alias_method` like 
>> following?
>>
>> ```rb
>> [FalseClass, Object, NilClass, Numeric, String, TrueClass].each do |klass|
>>   # :nocov:
>>   if klass.method_defined?(:blank?)
>>     klass.send(:alias_method, :blank?, :blank?)
>>   end
>>   # :nocov:
>> end
>> ```
>>
>
> This self-aliasing is done to avoid warning messages in verbose warning 
> mode if an existing blank? method is already defined.  It's the officially 
> recommended way of avoiding the warning messages.
>
> Thanks,
> Jeremy
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/a56c5f79-5f37-47e1-8627-6d3683cae5a1n%40googlegroups.com.

Reply via email to