Sha256: a0339a8d918b186edaaffa15cfc93c2bb3fbb2320e3659ae0f61314bd42b4562

Contents?: true

Size: 1.46 KB

Versions: 14

Compression:

Stored size: 1.46 KB

Contents

# frozen_string_literal: true

module ConvenientService
  module Support
    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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
convenient_service-0.18.0 lib/convenient_service/support/version/null_version.rb
convenient_service-0.17.0 lib/convenient_service/support/version/null_version.rb
convenient_service-0.16.0 lib/convenient_service/support/version/null_version.rb
convenient_service-0.15.0 lib/convenient_service/support/version/null_version.rb
convenient_service-0.14.0 lib/convenient_service/support/version/null_version.rb
convenient_service-0.13.0 lib/convenient_service/support/version/null_version.rb
convenient_service-0.12.0 lib/convenient_service/support/version/null_version.rb
convenient_service-0.11.0 lib/convenient_service/support/version/null_version.rb
convenient_service-0.10.1 lib/convenient_service/support/version/null_version.rb
convenient_service-0.10.0 lib/convenient_service/support/version/null_version.rb
convenient_service-0.9.0 lib/convenient_service/support/version/null_version.rb
convenient_service-0.8.0 lib/convenient_service/support/version/null_version.rb
convenient_service-0.7.0 lib/convenient_service/support/version/null_version.rb
convenient_service-0.6.0 lib/convenient_service/support/version/null_version.rb