Module: Solargraph::Pin::Localized

Included in:
BlockParameter, LocalVariable
Defined in:
lib/solargraph/pin/localized.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



4
5
6
# File 'lib/solargraph/pin/localized.rb', line 4

def block
  @block
end

#presenceRange (readonly)

Returns:



7
8
9
# File 'lib/solargraph/pin/localized.rb', line 7

def presence
  @presence
end

Instance Method Details

#visible_from?(other, position) ⇒ Boolean

Parameters:

  • other (Pin::Base)

    The caller’s block

  • position (Position)

    The caller’s position

Returns:

  • (Boolean)


12
13
14
15
16
17
18
# File 'lib/solargraph/pin/localized.rb', line 12

def visible_from?(other, position)
  other.filename == filename and
    ( other == block or 
      (block.location.range.contain?(other.location.range.start) and block.location.range.contain?(other.location.range.ending))
    ) and
    presence.contain?(position)
end