Sha256: e2e2e6aec2d04a43cebcf3c63b699dbf1e9859f8ec26f62a8f1c8c563ba7e4d2
Contents?: true
Size: 742 Bytes
Versions: 11
Compression:
Stored size: 742 Bytes
Contents
# typed: strict # frozen_string_literal: true module Tapioca module Gem module Listeners class SorbetEnums < Base extend T::Sig private sig { override.params(event: ScopeNodeAdded).void } def on_scope(event) constant = event.constant return unless T::Enum > event.constant enums = T.unsafe(constant).values.map do |enum_type| enum_type.instance_variable_get(:@const_name).to_s end event.node << RBI::TEnumBlock.new(enums) end sig { override.params(event: NodeAdded).returns(T::Boolean) } def ignore?(event) event.is_a?(Tapioca::Gem::ForeignScopeNodeAdded) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems