Module: Holistic::Ruby::Reference::FindReferencedScope

Extended by:
FindReferencedScope
Included in:
FindReferencedScope
Defined in:
lib/holistic/ruby/reference/find_referenced_scope.rb

Instance Method Summary collapse

Instance Method Details

#call(application:, cursor:) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/holistic/ruby/reference/find_referenced_scope.rb', line 7

def call(application:, cursor:)
  reference = application.references.find_by_cursor(cursor)

  return :not_found if reference.nil?
  return :could_not_find_referenced_scope if reference.referenced_scope.nil?

  referenced_scope = reference.referenced_scope

  [:referenced_scope_found, {reference:, referenced_scope:}]
end