Module: MethodAndProcExtensions
Constant Summary collapse
- KEYWORD_PARAMETER_TYPES =
%i(key keyreq keyrest).freeze
Instance Method Summary collapse
- #accepts_keywords ⇒ Object
-
#loosen_args ⇒ Object
returns a version of the procedure that accepts any number of arguments.
Instance Method Details
#accepts_keywords ⇒ Object
14 15 16 |
# File 'lib/abstractivator/proc_ext.rb', line 14 def accepts_keywords @accepts_keywords ||= parameters.any?{|param| KEYWORD_PARAMETER_TYPES.include?(param.first)} end |
#loosen_args ⇒ Object
returns a version of the procedure that accepts any number of arguments
6 7 8 9 10 |
# File 'lib/abstractivator/proc_ext.rb', line 6 def loosen_args proc do |*args, **kws, &block| Proc.loose_call(self, args, kws, &block) end end |