Class: Cmdlet::Comparison::Or

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

Overview

Or: Return true if any value is truthy.

Instance Method Summary collapse

Methods inherited from BaseCmdlet

#tokenizer

Instance Method Details

#call(*values) ⇒ String

Return true when first value is truthy

Parameters:

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

Returns:

  • (String)

    return true when first value is truthy



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

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