Module: Tapioca::Dsl::Helpers::ParamHelper
- Extended by:
- T::Sig
- Includes:
- SignaturesHelper
- Included in:
- Compiler
- Defined in:
- lib/tapioca/dsl/helpers/param_helper.rb
Instance Method Summary
collapse
-
#create_block_param(name, type:) ⇒ Object
-
#create_kw_opt_param(name, type:, default:) ⇒ Object
-
#create_kw_param(name, type:) ⇒ Object
-
#create_kw_rest_param(name, type:) ⇒ Object
-
#create_opt_param(name, type:, default:) ⇒ Object
-
#create_param(name, type:) ⇒ Object
-
#create_rest_param(name, type:) ⇒ Object
-
#create_typed_param(param, type) ⇒ Object
#sanitize_signature_types
Instance Method Details
#create_block_param(name, type:) ⇒ Object
44
45
46
|
# File 'lib/tapioca/dsl/helpers/param_helper.rb', line 44
def create_block_param(name, type:)
create_typed_param(RBI::BlockParam.new(name), type)
end
|
#create_kw_opt_param(name, type:, default:) ⇒ Object
34
35
36
|
# File 'lib/tapioca/dsl/helpers/param_helper.rb', line 34
def create_kw_opt_param(name, type:, default:)
create_typed_param(RBI::KwOptParam.new(name, default), type)
end
|
#create_kw_param(name, type:) ⇒ Object
29
30
31
|
# File 'lib/tapioca/dsl/helpers/param_helper.rb', line 29
def create_kw_param(name, type:)
create_typed_param(RBI::KwParam.new(name), type)
end
|
#create_kw_rest_param(name, type:) ⇒ Object
39
40
41
|
# File 'lib/tapioca/dsl/helpers/param_helper.rb', line 39
def create_kw_rest_param(name, type:)
create_typed_param(RBI::KwRestParam.new(name), type)
end
|
#create_opt_param(name, type:, default:) ⇒ Object
19
20
21
|
# File 'lib/tapioca/dsl/helpers/param_helper.rb', line 19
def create_opt_param(name, type:, default:)
create_typed_param(RBI::OptParam.new(name, default), type)
end
|
#create_param(name, type:) ⇒ Object
14
15
16
|
# File 'lib/tapioca/dsl/helpers/param_helper.rb', line 14
def create_param(name, type:)
create_typed_param(RBI::Param.new(name), type)
end
|
#create_rest_param(name, type:) ⇒ Object
24
25
26
|
# File 'lib/tapioca/dsl/helpers/param_helper.rb', line 24
def create_rest_param(name, type:)
create_typed_param(RBI::RestParam.new(name), type)
end
|
#create_typed_param(param, type) ⇒ Object
49
50
51
|
# File 'lib/tapioca/dsl/helpers/param_helper.rb', line 49
def create_typed_param(param, type)
RBI::TypedParam.new(param: param, type: sanitize_signature_types(type))
end
|