Module: JRuby::Lint::Checker
- Included in:
- JRuby::Lint::Checkers::ForkExec, JRuby::Lint::Checkers::Gem, JRuby::Lint::Checkers::Gemspec, JRuby::Lint::Checkers::NonAtomic, JRuby::Lint::Checkers::ObjectSpace, JRuby::Lint::Checkers::System, JRuby::Lint::Checkers::ThreadCritical
- Defined in:
- lib/jruby/lint/checkers.rb
Instance Attribute Summary collapse
-
#collector ⇒ Object
Returns the value of attribute collector.
Class Method Summary collapse
Instance Method Summary collapse
- #grand_parent ⇒ Object
-
#parent ⇒ Object
What is parent during visit of the current node being visited.
-
#src_line(line) ⇒ Object
source line with line node provides.
Instance Attribute Details
#collector ⇒ Object
Returns the value of attribute collector.
31 32 33 |
# File 'lib/jruby/lint/checkers.rb', line 31 def collector @collector end |
Class Method Details
.included(cls) ⇒ Object
5 6 7 |
# File 'lib/jruby/lint/checkers.rb', line 5 def self.included(cls) loaded_checkers << cls end |
.loaded_checkers ⇒ Object
9 10 11 |
# File 'lib/jruby/lint/checkers.rb', line 9 def self.loaded_checkers @checkers ||= [] end |
Instance Method Details
#grand_parent ⇒ Object
21 22 23 |
# File 'lib/jruby/lint/checkers.rb', line 21 def grand_parent collector.stack.size >= 3 ? collector.stack[-3] : nil end |
#parent ⇒ Object
What is parent during visit of the current node being visited.
17 18 19 |
# File 'lib/jruby/lint/checkers.rb', line 17 def parent collector.stack.size >= 2 ? collector.stack[-2] : nil end |
#src_line(line) ⇒ Object
source line with line node provides
27 28 29 |
# File 'lib/jruby/lint/checkers.rb', line 27 def src_line(line) collector.contents.split(/\n/)[line] end |