Sha256: 5a122a5781968ec58b5c21ae195e862ca1f2f7fbd63d20e7548ce97fbfa4f338

Contents?: true

Size: 1.36 KB

Versions: 4

Compression:

Stored size: 1.36 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 [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

4 entries across 4 versions & 1 rubygems

Version Path
convenient_service-0.5.0 lib/convenient_service/support/version/null_version.rb
convenient_service-0.4.0 lib/convenient_service/support/version/null_version.rb
convenient_service-0.3.1 lib/convenient_service/support/version/null_version.rb
convenient_service-0.3.0 lib/convenient_service/support/version/null_version.rb