Class: PrivateDetective::AnalyzeNode
- Inherits:
-
Object
- Object
- PrivateDetective::AnalyzeNode
- Defined in:
- lib/private_detective/analyze_node.rb
Constant Summary collapse
- ACCESS_CONTROL_KEYWORDS =
%i[public private protected].freeze
Instance Attribute Summary collapse
-
#class_body ⇒ Object
readonly
Returns the value of attribute class_body.
-
#class_details ⇒ Object
readonly
Returns the value of attribute class_details.
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#report ⇒ Object
readonly
Returns the value of attribute report.
-
#super_class ⇒ Object
readonly
Returns the value of attribute super_class.
Instance Method Summary collapse
-
#initialize(node:, file_path: nil) ⇒ AnalyzeNode
constructor
A new instance of AnalyzeNode.
-
#process_node ⇒ Hash
Report.
Constructor Details
#initialize(node:, file_path: nil) ⇒ AnalyzeNode
Returns a new instance of AnalyzeNode.
11 12 13 14 15 |
# File 'lib/private_detective/analyze_node.rb', line 11 def initialize(node:, file_path: nil) @class_details, @super_class, @class_body = *node @file_path = file_path @report = { class_name => [] } end |
Instance Attribute Details
#class_body ⇒ Object (readonly)
Returns the value of attribute class_body.
8 9 10 |
# File 'lib/private_detective/analyze_node.rb', line 8 def class_body @class_body end |
#class_details ⇒ Object (readonly)
Returns the value of attribute class_details.
8 9 10 |
# File 'lib/private_detective/analyze_node.rb', line 8 def class_details @class_details end |
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
8 9 10 |
# File 'lib/private_detective/analyze_node.rb', line 8 def file_path @file_path end |
#report ⇒ Object (readonly)
Returns the value of attribute report.
8 9 10 |
# File 'lib/private_detective/analyze_node.rb', line 8 def report @report end |
#super_class ⇒ Object (readonly)
Returns the value of attribute super_class.
8 9 10 |
# File 'lib/private_detective/analyze_node.rb', line 8 def super_class @super_class end |
Instance Method Details
#process_node ⇒ Hash
Returns report.
18 19 20 21 22 |
# File 'lib/private_detective/analyze_node.rb', line 18 def process_node return unless class_pattern? create_report end |