Sha256: cfdc0c23a57b86f742836760ae4e494af276a087f446f136ea55e87c0b488385

Contents?: true

Size: 484 Bytes

Versions: 30

Compression:

Stored size: 484 Bytes

Contents

# frozen_string_literal: true

module Cmdlet
  # Comparison helpers, eg. or, and, equal, not equal, less than, greater than etc.
  module Comparison
    # Or: Return true if any value is truthy.
    class Or < Cmdlet::BaseCmdlet
      #
      # @param [Object] values - list of values (via *splat) to be checked via AND condition
      # @return [String] return true when first value is truthy
      def call(*values)
        values.any? { |value| value }
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
cmdlet-0.14.0 lib/cmdlet/comparison/or.rb
cmdlet-0.13.2 lib/cmdlet/comparison/or.rb
cmdlet-0.13.1 lib/cmdlet/comparison/or.rb
cmdlet-0.13.0 lib/cmdlet/comparison/or.rb
cmdlet-0.12.5 lib/cmdlet/comparison/or.rb
cmdlet-0.12.4 lib/cmdlet/comparison/or.rb
cmdlet-0.12.3 lib/cmdlet/comparison/or.rb
cmdlet-0.12.2 lib/cmdlet/comparison/or.rb
cmdlet-0.12.1 lib/cmdlet/comparison/or.rb
cmdlet-0.12.0 lib/cmdlet/comparison/or.rb
cmdlet-0.11.0 lib/cmdlet/comparison/or.rb
cmdlet-0.10.1 lib/cmdlet/comparison/or.rb
cmdlet-0.10.0 lib/cmdlet/comparison/or.rb
cmdlet-0.9.2 lib/cmdlet/comparison/or.rb
cmdlet-0.9.1 lib/cmdlet/comparison/or.rb
cmdlet-0.9.0 lib/cmdlet/comparison/or.rb
cmdlet-0.8.0 lib/cmdlet/comparison/or.rb
cmdlet-0.7.1 lib/cmdlet/comparison/or.rb
cmdlet-0.7.0 lib/cmdlet/comparison/or.rb
cmdlet-0.6.2 lib/cmdlet/comparison/or.rb