Module: T::Helpers
- Included in:
- Generic, Props, Props::ClassMethods, Props::Plugin
- Defined in:
- lib/types/helpers.rb,
lib/sorbet-runtime.rb
Overview
Use as a mixin with extend (‘extend T::Helpers`). Docs at confluence.corp.stripe.com/display/PRODINFRA/Ruby+Types
Constant Summary collapse
Instance Method Summary collapse
-
#abstract! ⇒ Object
Class/Module Helpers ###.
- #final! ⇒ Object
- #interface! ⇒ Object
-
#mixes_in_class_methods(mod) ⇒ Object
Causes a mixin to also mix in class methods from the named module.
Instance Method Details
#abstract! ⇒ Object
Class/Module Helpers ###
11 12 13 |
# File 'lib/types/helpers.rb', line 11 def abstract! Private::Abstract::Declare.declare_abstract(self, type: :abstract) end |
#final! ⇒ Object
19 20 21 |
# File 'lib/types/helpers.rb', line 19 def final! Private::Final.declare(self) end |
#interface! ⇒ Object
15 16 17 |
# File 'lib/types/helpers.rb', line 15 def interface! Private::Abstract::Declare.declare_abstract(self, type: :interface) end |
#mixes_in_class_methods(mod) ⇒ Object
Causes a mixin to also mix in class methods from the named module.
Nearly equivalent to
def self.included(other)
other.extend(mod)
end
Except that it is statically analyzed by sorbet.
32 33 34 |
# File 'lib/types/helpers.rb', line 32 def mixes_in_class_methods(mod) Private::Mixins.declare_mixes_in_class_methods(self, mod) end |