Class: Rucoa::Handlers::TextDocumentDocumentHighlightHandler::NodeToHighlightsMappers::IfMapper

Inherits:
Base
  • Object
show all
Defined in:
lib/rucoa/handlers/text_document_document_highlight_handler.rb

Direct Known Subclasses

ElsifMapper

Instance Method Summary collapse

Methods inherited from Base

call, #initialize

Constructor Details

This class inherits a constructor from Rucoa::Handlers::TextDocumentDocumentHighlightHandler::NodeToHighlightsMappers::Base

Instance Method Details

#callArray

Returns:

  • (Array)


222
223
224
225
226
227
228
229
230
231
232
# File 'lib/rucoa/handlers/text_document_document_highlight_handler.rb', line 222

def call
  return AnyMapper.call(@node.parent) if @node.elsif?
  return [] if @node.modifier?

  [
    highlight_keyword,
    *highlights_elsif,
    highlight_else,
    highlight_end
  ].compact
end