Module: Capistrano::ProcHelpers
- Included in:
- Configuration::ValidatedVariables, Configuration::Variables
- Defined in:
- lib/capistrano/proc_helpers.rb
Class Method Summary collapse
-
.callable_without_parameters?(x) ⇒ Boolean
Tests whether the given object appears to respond to ‘call` with zero parameters.
Class Method Details
.callable_without_parameters?(x) ⇒ Boolean
Tests whether the given object appears to respond to ‘call` with zero parameters. In Capistrano, such a proc is used to represent a “deferred value”. That is, a value that is resolved by invoking `call` at the time it is first needed.
9 10 11 |
# File 'lib/capistrano/proc_helpers.rb', line 9 def callable_without_parameters?(x) x.respond_to?(:call) && (!x.respond_to?(:arity) || x.arity.zero?) end |