Class: Rucoa::Rbs::MethodDefinitionMapper

Inherits:
Object
  • Object
show all
Defined in:
lib/rucoa/rbs/method_definition_mapper.rb

Defined Under Namespace

Classes: MethodTypeMapper

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(declaration:, method_definition:) ⇒ MethodDefinitionMapper

Returns a new instance of MethodDefinitionMapper.

Parameters:

  • declaration (RBS::AST::Declarations::Class, RBS::AST::Declarations::Module)
  • method_definition (RBS::AST::Members::MethodDefinition)


23
24
25
26
27
28
29
# File 'lib/rucoa/rbs/method_definition_mapper.rb', line 23

def initialize(
  declaration:,
  method_definition:
)
  @declaration = declaration
  @method_definition = method_definition
end

Class Method Details

.call(declaration:, method_definition:) ⇒ Rucoa::Definitions::MethodDefinition

Parameters:

  • declaration (RBS::AST::Declarations::Class, RBS::AST::Declarations::Module)
  • method_definition (RBS::AST::Members::MethodDefinition)

Returns:



10
11
12
13
14
15
16
17
18
# File 'lib/rucoa/rbs/method_definition_mapper.rb', line 10

def call(
  declaration:,
  method_definition:
)
  new(
    declaration: declaration,
    method_definition: method_definition
  ).call
end

Instance Method Details

#callRucoa::Definitions::MethodDefinition



32
33
34
35
36
37
38
39
40
41
# File 'lib/rucoa/rbs/method_definition_mapper.rb', line 32

def call
  Definitions::MethodDefinition.new(
    description: description,
    kind: kind,
    location: location,
    method_name: method_name,
    namespace: namespace,
    types: types
  )
end