Class: ScoutApm::AutoInstrument::Cache
- Inherits:
-
Object
- Object
- ScoutApm::AutoInstrument::Cache
- Defined in:
- lib/scout_apm/auto_instrument/parser.rb
Instance Method Summary collapse
-
#initialize ⇒ Cache
constructor
A new instance of Cache.
- #local_assignments?(node) ⇒ Boolean
Constructor Details
#initialize ⇒ Cache
Returns a new instance of Cache.
8 9 10 |
# File 'lib/scout_apm/auto_instrument/parser.rb', line 8 def initialize @local_assignments = {} end |
Instance Method Details
#local_assignments?(node) ⇒ Boolean
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/scout_apm/auto_instrument/parser.rb', line 12 def local_assignments?(node) unless @local_assignments.key?(node) if node.type == :lvasgn @local_assignments[node] = true elsif node.children.find{|child| child.is_a?(Parser::AST::Node) && self.local_assignments?(child)} @local_assignments[node] = true else @local_assignments[node] = false end end return @local_assignments[node] end |