Module: T::Generic
- Includes:
- Kernel, Helpers
- Defined in:
- lib/types/generic.rb
Overview
Use as a mixin with extend (‘extend T::Generic`). Docs at hackpad.corp.stripe.com/Type-Validation-in-pay-server-1JaoTHir5Mo.
Constant Summary
Constants included from Helpers
Instance Method Summary collapse
-
#[](*types) ⇒ Object
Class/Module Helpers ###.
- #type_member(variance = :invariant, fixed: nil, lower: T.untyped, upper: BasicObject) ⇒ Object
- #type_template(variance = :invariant, fixed: nil, lower: T.untyped, upper: BasicObject) ⇒ Object
Methods included from Helpers
#abstract!, #final!, #interface!, #mixes_in_class_methods
Instance Method Details
#[](*types) ⇒ Object
Class/Module Helpers ###
12 13 14 |
# File 'lib/types/generic.rb', line 12 def [](*types) self end |
#type_member(variance = :invariant, fixed: nil, lower: T.untyped, upper: BasicObject) ⇒ Object
16 17 18 |
# File 'lib/types/generic.rb', line 16 def type_member(variance=:invariant, fixed: nil, lower: T.untyped, upper: BasicObject) T::Types::TypeMember.new(variance) # rubocop:disable PrisonGuard/UseOpusTypesShortcut end |
#type_template(variance = :invariant, fixed: nil, lower: T.untyped, upper: BasicObject) ⇒ Object
20 21 22 |
# File 'lib/types/generic.rb', line 20 def type_template(variance=:invariant, fixed: nil, lower: T.untyped, upper: BasicObject) T::Types::TypeTemplate.new(variance) # rubocop:disable PrisonGuard/UseOpusTypesShortcut end |