Module: Types::Float

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

Overview

Represents a floating point type.

type = Types::Float
type.parse("3.14") # => 3.14

Class Method Summary collapse

Methods included from Generic

composite?, to_rbs, to_s, |

Class Method Details

.parse(input) ⇒ Object

Parses the input as a float.



22
23
24
# File 'lib/types/float.rb', line 22

def self.parse(input)
	Float(input)
end

.resolve ⇒ Object

Resolves to the actual Ruby Float class.



33
34
35
# File 'lib/types/float.rb', line 33

def self.resolve
	::Float
end

.to_rbs ⇒ Object



27
28
29
# File 'lib/types/float.rb', line 27

def self.to_rbs
	"Float"
end