Class: Rucoa::Rbs::MethodDefinitionMapper::MethodTypeMapper
- Inherits:
-
Object
- Object
- Rucoa::Rbs::MethodDefinitionMapper::MethodTypeMapper
- Defined in:
- lib/rucoa/rbs/method_definition_mapper.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Rucoa::Types::MethodType
-
#initialize(method_type:) ⇒ MethodTypeMapper
constructor
A new instance of MethodTypeMapper.
Constructor Details
#initialize(method_type:) ⇒ MethodTypeMapper
Returns a new instance of MethodTypeMapper.
95 96 97 |
# File 'lib/rucoa/rbs/method_definition_mapper.rb', line 95 def initialize(method_type:) @method_type = method_type end |
Class Method Details
.call(method_type:) ⇒ Rucoa::Types::MethodType
83 84 85 |
# File 'lib/rucoa/rbs/method_definition_mapper.rb', line 83 def call(method_type:) new(method_type: method_type).call end |
.stringify(type) ⇒ String
89 90 91 |
# File 'lib/rucoa/rbs/method_definition_mapper.rb', line 89 def stringify(type) type.to_s.delete_prefix('::') end |
Instance Method Details
#call ⇒ Rucoa::Types::MethodType
100 101 102 103 104 105 |
# File 'lib/rucoa/rbs/method_definition_mapper.rb', line 100 def call Types::MethodType.new( parameters_string: @method_type.type.param_to_s, return_type: self.class.stringify(@method_type.type.return_type) ) end |