Sha256: 33c4cec166ed3b5d2334fb7d1aa4b1c3380372d796782f2c0f1a363ddf49e446

Contents?: true

Size: 535 Bytes

Versions: 9

Compression:

Stored size: 535 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module RBS
    module OnTypeHelper
      def on_type(types, type, &block)
        case type
        when *types
          yield type
        end
        type.each_type do |t|
          on_type(types, t, &block)
        end
      end

      def on_not_type(types, type, &block)
        case type
        when *types
          # not
        else
          yield type
        end
        type.each_type do |t|
          on_not_type(types, t, &block)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rubocop-on-rbs-1.3.0 lib/rubocop/rbs/on_type_helper.rb
rubocop-on-rbs-1.2.0 lib/rubocop/rbs/on_type_helper.rb
rubocop-on-rbs-1.1.0 lib/rubocop/rbs/on_type_helper.rb
rubocop-on-rbs-1.0.0 lib/rubocop/rbs/on_type_helper.rb
rubocop-on-rbs-0.9.0 lib/rubocop/rbs/on_type_helper.rb
rubocop-on-rbs-0.8.0 lib/rubocop/rbs/on_type_helper.rb
rubocop-on-rbs-0.7.0 lib/rubocop/rbs/on_type_helper.rb
rubocop-on-rbs-0.6.0 lib/rubocop/rbs/on_type_helper.rb
rubocop-on-rbs-0.5.0 lib/rubocop/rbs/on_type_helper.rb