Class: SorbetRails::Config

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/sorbet-rails/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.


50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/sorbet-rails/config.rb', line 50

def initialize
  @enabled_gem_plugins = []
  @enabled_model_plugins = [
    :active_record_enum,
    :active_record_named_scope,
    :active_record_querying,
    :active_relation_where_not,
    :active_record_serialized_attribute,
    :active_record_attribute,
    :active_record_assoc,
    :custom_finder_methods,
    :enumerable_collections,
  ]
  @enabled_model_plugins << :active_storage_methods if defined?(T.unsafe(ActiveStorage))
  @extra_helper_includes = []
  @mailer_generator_class = SorbetRails::MailerRbiFormatter
  @job_generator_class = SorbetRails::JobRbiFormatter
end

Instance Attribute Details

#enabled_gem_pluginsObject

Returns the value of attribute enabled_gem_plugins


35
36
37
# File 'lib/sorbet-rails/config.rb', line 35

def enabled_gem_plugins
  @enabled_gem_plugins
end

#enabled_model_pluginsObject

Returns the value of attribute enabled_model_plugins


38
39
40
# File 'lib/sorbet-rails/config.rb', line 38

def enabled_model_plugins
  @enabled_model_plugins
end

#extra_helper_includesObject

Returns the value of attribute extra_helper_includes


41
42
43
# File 'lib/sorbet-rails/config.rb', line 41

def extra_helper_includes
  @extra_helper_includes
end

#job_generator_classObject

Returns the value of attribute job_generator_class


44
45
46
# File 'lib/sorbet-rails/config.rb', line 44

def job_generator_class
  @job_generator_class
end

#mailer_generator_classObject

Returns the value of attribute mailer_generator_class


47
48
49
# File 'lib/sorbet-rails/config.rb', line 47

def mailer_generator_class
  @mailer_generator_class
end

Instance Method Details

#enabled_pluginsObject


70
71
72
# File 'lib/sorbet-rails/config.rb', line 70

def enabled_plugins
  @enabled_model_plugins + @enabled_gem_plugins
end