Module: Braid::T
- Defined in:
- lib/braid/sorbet/fake_runtime.rb
Defined Under Namespace
Modules: Array, Hash, Sig
Classes: FakeType, Struct
Constant Summary
collapse
- FAKE_TYPE =
FakeType.instance
- Boolean =
FAKE_TYPE
Class Method Summary
collapse
Class Method Details
.any(*types) ⇒ Object
62
63
64
|
# File 'lib/braid/sorbet/fake_runtime.rb', line 62
def self.any(*types)
FAKE_TYPE
end
|
.bind(value, type) ⇒ Object
42
|
# File 'lib/braid/sorbet/fake_runtime.rb', line 42
def self.bind(value, type); end
|
.cast(value, type) ⇒ Object
NOTICE: Like everything else in the fake Sorbet runtime (e.g., ‘sig`), these do not actually perform runtime checks. Currently, if you want a runtime check, you have to implement it yourself. We considered defining wrapper functions with different names to make this clearer, but then we’d lose the extra static checks that Sorbet performs on direct calls to ‘T.cast` and `T.must`.
33
34
35
|
# File 'lib/braid/sorbet/fake_runtime.rb', line 33
def self.cast(value, type)
value
end
|
.let(value, type) ⇒ Object
23
24
25
|
# File 'lib/braid/sorbet/fake_runtime.rb', line 23
def self.let(value, type)
value
end
|
.must(value) ⇒ Object
36
37
38
|
# File 'lib/braid/sorbet/fake_runtime.rb', line 36
def self.must(value)
value
end
|
.nilable(type) ⇒ Object
53
54
55
|
# File 'lib/braid/sorbet/fake_runtime.rb', line 53
def self.nilable(type)
FAKE_TYPE
end
|
.noreturn ⇒ Object
59
60
61
|
# File 'lib/braid/sorbet/fake_runtime.rb', line 59
def self.noreturn
FAKE_TYPE
end
|
.type_alias ⇒ Object
49
50
51
|
# File 'lib/braid/sorbet/fake_runtime.rb', line 49
def self.type_alias
FAKE_TYPE
end
|
.unsafe(value) ⇒ Object
39
40
41
|
# File 'lib/braid/sorbet/fake_runtime.rb', line 39
def self.unsafe(value)
value
end
|
.untyped ⇒ Object
56
57
58
|
# File 'lib/braid/sorbet/fake_runtime.rb', line 56
def self.untyped
FAKE_TYPE
end
|