Sha256: 2bbd82fd7a10d4f758e4b12520094f866add55f83925696126ad838bc6a0fdcf

Contents?: true

Size: 1.63 KB

Versions: 2

Compression:

Stored size: 1.63 KB

Contents

# frozen_string_literal: true

module ConvenientService
  module Dependencies
    module Queries
      class Version
        ##
        # @api private
        #
        # @internal
        #   - https://thoughtbot.com/blog/rails-refactoring-example-introduce-null-object
        #   - https://avdi.codes/null-objects-and-falsiness/
        #
        class NullVersion
          ##
          # @return [Boolean]
          #
          def null_version?
            true
          end

          ##
          # @return [nil]
          #
          def gem_version
            nil
          end

          ##
          # @param other [Object] Can be any type.
          # @return [nil]
          #
          def <=>(other)
            nil
          end

          ##
          # @param other [Object] Can be any type.
          # @return [nil]
          #
          def <(other)
            nil
          end

          ##
          # @param other [Object] Can be any type.
          # @return [nil]
          #
          def <=(other)
            nil
          end

          ##
          # @param other [Object] Can be any type.
          # @return [nil]
          #
          def ==(other)
            nil
          end

          ##
          # @param other [Object] Can be any type.
          # @return [nil]
          #
          def >(other)
            nil
          end

          ##
          # @param other [Object] Can be any type.
          # @return [nil]
          #
          def >=(other)
            nil
          end

          ##
          # @return [String]
          #
          def to_s
            ""
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
convenient_service-0.19.1 lib/convenient_service/dependencies/queries/version/null_version.rb
convenient_service-0.19.0 lib/convenient_service/dependencies/queries/version/null_version.rb