Class: Rucoa::Yard::DefinitionGenerators::AttributeReaderDefinitionGenerator
- Inherits:
-
Base
- Object
- Base
- Rucoa::Yard::DefinitionGenerators::AttributeReaderDefinitionGenerator
- Defined in:
- lib/rucoa/yard/definition_generators/attribute_reader_definition_generator.rb
Constant Summary collapse
- READER_METHOD_NAMES =
::Set[ 'attr_accessor', 'attr_reader' ].freeze
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Rucoa::Yard::DefinitionGenerators::Base
Instance Method Details
#call ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/rucoa/yard/definition_generators/attribute_reader_definition_generator.rb', line 52 def call return [] unless @node.is_a?(Nodes::SendNode) && READER_METHOD_NAMES.include?(@node.name) @node.arguments.filter_map do |argument| next unless argument.respond_to?(:value) Definitions::MethodDefinition.new( description: description, kind: :instance, location: location, method_name: argument.value.to_s, namespace: @node.namespace, types: return_types.map do |type| Types::MethodType.new( parameters_string: '', # TODO return_type: type ) end ) end end |