Module: SorbetBaml::EnumExtensions

Extended by:
T::Sig
Defined in:
lib/sorbet_baml/enum_extensions.rb

Overview

Extensions to add BAML conversion methods to T::Enum

Instance Method Summary collapse

Instance Method Details

#baml_type_definition(options = {}) ⇒ Object



19
20
21
# File 'lib/sorbet_baml/enum_extensions.rb', line 19

def baml_type_definition(options = {})
  SorbetBaml::Converter.from_enum(T.cast(self, T.class_of(T::Enum)), options)
end

#to_baml(options = {}) ⇒ Object



13
14
15
# File 'lib/sorbet_baml/enum_extensions.rb', line 13

def to_baml(options = {})
  baml_type_definition(options)
end