Sha256: 7cb1f8255ca9e9fc22981a3d0b5be2914abdc8f07ff50b24634b4f34ff65b8c8

Contents?: true

Size: 599 Bytes

Versions: 30

Compression:

Stored size: 599 Bytes

Contents

# frozen_string_literal: true

module Cmdlet
  # Comparison helpers, eg. or, and, equal, not equal, less than, greater than etc.
  module Comparison
    # Eq: Return true if two values are equal
    class Eq < Cmdlet::BaseCmdlet
      #
      # @param [Object] lhs - lhs - left hand side value
      # @param [Object] rhs - rhs - right hand side value
      # @return [String] return truthy value if left hand side equals right hand side
      def call(lhs, rhs)
        lhs = lhs.to_s if lhs.is_a?(Symbol)
        rhs = rhs.to_s if rhs.is_a?(Symbol)

        lhs == rhs
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
cmdlet-0.6.1 lib/cmdlet/comparison/eq.rb
cmdlet-0.6.0 lib/cmdlet/comparison/eq.rb
cmdlet-0.5.0 lib/cmdlet/comparison/eq.rb
cmdlet-0.4.2 lib/cmdlet/comparison/eq.rb
cmdlet-0.4.1 lib/cmdlet/comparison/eq.rb
cmdlet-0.4.0 lib/cmdlet/comparison/eq.rb
cmdlet-0.3.0 lib/cmdlet/comparison/eq.rb
cmdlet-0.2.1 lib/cmdlet/comparison/eq.rb
cmdlet-0.2.0 lib/cmdlet/comparison/eq.rb
cmdlet-0.1.2 lib/cmdlet/comparison/eq.rb