Class: Rucoa::Rbs::ConstantDefinitionMapper

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(declaration:) ⇒ ConstantDefinitionMapper

Returns a new instance of ConstantDefinitionMapper.

Parameters:

  • declaration (RBS::AST::Declarations::Constant)


15
16
17
# File 'lib/rucoa/rbs/constant_definition_mapper.rb', line 15

def initialize(declaration:)
  @declaration = declaration
end

Class Method Details

.call(declaration:) ⇒ Rucoa::Definitions::ConstantDefinition

Parameters:

  • declaration (RBS::AST::Declarations::Constant)

Returns:



9
10
11
# File 'lib/rucoa/rbs/constant_definition_mapper.rb', line 9

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

Instance Method Details

#callRucoa::Definitions::ConstantDefinition



20
21
22
23
24
25
26
# File 'lib/rucoa/rbs/constant_definition_mapper.rb', line 20

def call
  Definitions::ConstantDefinition.new(
    description: description,
    location: location,
    qualified_name: qualified_name
  )
end