Class: Cmdlet::Comparison::And

Inherits:
BaseCmdlet show all
Defined in:
lib/cmdlet/comparison/and.rb

Overview

And: Return true if **all of** the given values are truthy.

Instance Method Summary collapse

Methods inherited from BaseCmdlet

#tokenizer

Instance Method Details

#call(*values) ⇒ String

Return true when every value is truthy

Parameters:

  • values (Object)
    • list of values (via *splat) to be checked via AND condition

Returns:

  • (String)

    return true when every value is truthy



11
12
13
# File 'lib/cmdlet/comparison/and.rb', line 11

def call(*values)
  values.all? { |value| value }
end