Module: Types::Symbol

Extended by:
Generic
Defined in:
lib/types/symbol.rb

Overview

Represents a symbol type.

“‘ruby type = Types::Symbol type.parse(“foo”) # => :foo “`

Class Method Summary collapse

Methods included from Generic

composite?, to_rbs, to_s, |

Class Method Details

.parse(input) ⇒ Object

Parses the input as a symbol.



21
22
23
# File 'lib/types/symbol.rb', line 21

def self.parse(input)
	input.to_sym
end

.resolveObject

Resolves to the actual Ruby Symbol class.



32
33
34
# File 'lib/types/symbol.rb', line 32

def self.resolve
	::Symbol
end

.to_rbsObject



26
27
28
# File 'lib/types/symbol.rb', line 26

def self.to_rbs
	"Symbol"
end