Module: Types::Generic
- Included in:
- Array, Block, Boolean, Class, Class, Decimal, Enumerator, Float, Hash, Integer, Interface, Lambda, Method, Named, Nil, Numeric, String, Symbol, Tuple
- Defined in:
- lib/types/generic.rb
Overview
An extension module which allows constructing ‘Any` types using the `|` operator.
“‘ruby type = Types::String | Types::Integer “`
Instance Method Summary collapse
- #composite? ⇒ Boolean
-
#to_rbs ⇒ Object
By default, this is the same as to_s, but can be overridden by composite types.
- #to_s ⇒ Object
-
#|(other) ⇒ Object
Create an instance of ‘Any` with the arguments as types.
Instance Method Details
#to_rbs ⇒ Object
By default, this is the same as to_s, but can be overridden by composite types.
24 25 26 |
# File 'lib/types/generic.rb', line 24 def to_rbs to_s end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/types/generic.rb', line 34 def to_s self.name.rpartition("::").last end |