Class: Spoom::Sorbet::Translate::RBSCommentsToSorbetSigs::Options
- Inherits:
-
Object
- Object
- Spoom::Sorbet::Translate::RBSCommentsToSorbetSigs::Options
- Defined in:
- lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs/options.rb
Constant Summary collapse
- ALLOWED_OVERLOAD_STRATEGIES =
[:translate_all, :translate_last, :raise].freeze
Class Attribute Summary collapse
- .default ⇒ Object readonly
Instance Attribute Summary collapse
- #erase_generic_types ⇒ Object readonly
- #output_format ⇒ Object readonly
- #overloads_strategy ⇒ Object readonly
- #rbi_options ⇒ Object readonly
- #translate_abstract_methods ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(overloads_strategy: :translate_all, erase_generic_types: false, output_format: HumanReadableRBIFormat.default, translate_abstract_methods: true) ⇒ Options
constructor
A new instance of Options.
Constructor Details
#initialize(overloads_strategy: :translate_all, erase_generic_types: false, output_format: HumanReadableRBIFormat.default, translate_abstract_methods: true) ⇒ Options
Returns a new instance of Options.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs/options.rb', line 65 def initialize( overloads_strategy: :translate_all, erase_generic_types: false, output_format: HumanReadableRBIFormat.default, translate_abstract_methods: true ) unless ALLOWED_OVERLOAD_STRATEGIES.include?(overloads_strategy) raise ArgumentError, "Unknown overloads_strategy: #{overloads_strategy.inspect}. " \ "Must be one of: #{ALLOWED_OVERLOAD_STRATEGIES.map(&:inspect).join(", ")}" end @overloads_strategy = overloads_strategy @erase_generic_types = erase_generic_types @rbi_options = RBI::RBS::MethodTypeTranslator::Options.new(erase_generic_types:) #: RBI::RBS::MethodTypeTranslator::Options @output_format = output_format @translate_abstract_methods = translate_abstract_methods freeze end |
Class Attribute Details
.default ⇒ Object (readonly)
88 89 90 |
# File 'lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs/options.rb', line 88 def default @default end |
Instance Attribute Details
#erase_generic_types ⇒ Object (readonly)
48 49 50 |
# File 'lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs/options.rb', line 48 def erase_generic_types @erase_generic_types end |
#output_format ⇒ Object (readonly)
54 55 56 |
# File 'lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs/options.rb', line 54 def output_format @output_format end |
#overloads_strategy ⇒ Object (readonly)
43 44 45 |
# File 'lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs/options.rb', line 43 def overloads_strategy @overloads_strategy end |
#rbi_options ⇒ Object (readonly)
51 52 53 |
# File 'lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs/options.rb', line 51 def @rbi_options end |
#translate_abstract_methods ⇒ Object (readonly)
57 58 59 |
# File 'lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs/options.rb', line 57 def translate_abstract_methods @translate_abstract_methods end |