Class: Spoom::Sorbet::Sigs::SigsLocator
- Inherits:
-
RBI::Visitor
- Object
- RBI::Visitor
- Spoom::Sorbet::Sigs::SigsLocator
- Extended by:
- T::Sig
- Defined in:
- lib/spoom/sorbet/sigs.rb
Instance Attribute Summary collapse
-
#sigs ⇒ Object
readonly
Returns the value of attribute sigs.
Instance Method Summary collapse
-
#initialize ⇒ SigsLocator
constructor
A new instance of SigsLocator.
- #visit(node) ⇒ Object
Constructor Details
#initialize ⇒ SigsLocator
Returns a new instance of SigsLocator.
63 64 65 66 |
# File 'lib/spoom/sorbet/sigs.rb', line 63 def initialize super @sigs = T.let([], T::Array[[RBI::Sig, T.any(RBI::Method, RBI::Attr)]]) end |
Instance Attribute Details
#sigs ⇒ Object (readonly)
Returns the value of attribute sigs.
60 61 62 |
# File 'lib/spoom/sorbet/sigs.rb', line 60 def sigs @sigs end |
Instance Method Details
#visit(node) ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/spoom/sorbet/sigs.rb', line 69 def visit(node) return unless node case node when RBI::Method, RBI::Attr node.sigs.each do |sig| @sigs << [sig, node] end when RBI::Tree visit_all(node.nodes) end end |