You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: expected_version.rb
    path of file: ./repos/rails_event_store/ruby_event_store/lib/ruby_event_store
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module RubyEventStore
  class ExpectedVersion
    POSITION_DEFAULT = -1.freeze
    NOT_RESOLVED = Object.new.freeze

    def self.any
      new
    
    def resolve_for(stream, resolver = Proc.new {})
      invalid_version! if stream.global? && !any?

      case version
      when Integer
        version
      when :none
        POSITION_DEFAULT
      when :auto
        resolver[stream] || POSITION_DEFAULT
      end