Class: AdLint::Cpp::Group
- Inherits:
-
SyntaxNode
- Object
- SyntaxNode
- AdLint::Cpp::Group
- Defined in:
- lib/adlint/cpp/syntax.rb
Instance Attribute Summary collapse
-
#group_parts ⇒ Object
readonly
Returns the value of attribute group_parts.
Instance Method Summary collapse
-
#initialize ⇒ Group
constructor
A new instance of Group.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
- #push(group_part) ⇒ Object
Methods inherited from SyntaxNode
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize ⇒ Group
Returns a new instance of Group.
103 104 105 106 |
# File 'lib/adlint/cpp/syntax.rb', line 103 def initialize super @group_parts = [] end |
Instance Attribute Details
#group_parts ⇒ Object (readonly)
Returns the value of attribute group_parts.
108 109 110 |
# File 'lib/adlint/cpp/syntax.rb', line 108 def group_parts @group_parts end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
119 120 121 122 |
# File 'lib/adlint/cpp/syntax.rb', line 119 def inspect(indent = 0) ([" " * indent + short_class_name] + @group_parts.map { |child| child.inspect(indent + 1) }).join("\n") end |
#location ⇒ Object
115 116 117 |
# File 'lib/adlint/cpp/syntax.rb', line 115 def location @group_parts.first.location end |
#push(group_part) ⇒ Object
110 111 112 113 |
# File 'lib/adlint/cpp/syntax.rb', line 110 def push(group_part) @group_parts.push(group_part) self end |