Class: AdLint::Cpp::IfSection
- Inherits:
-
GroupPart
- Object
- SyntaxNode
- GroupPart
- AdLint::Cpp::IfSection
- Defined in:
- lib/adlint/cpp/syntax.rb
Instance Attribute Summary collapse
-
#elif_groups ⇒ Object
readonly
Returns the value of attribute elif_groups.
-
#else_group ⇒ Object
readonly
Returns the value of attribute else_group.
-
#endif_line ⇒ Object
readonly
Returns the value of attribute endif_line.
-
#if_group ⇒ Object
readonly
Returns the value of attribute if_group.
Instance Method Summary collapse
-
#initialize(if_group, elif_groups, else_group, endif_line) ⇒ IfSection
constructor
A new instance of IfSection.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
Methods inherited from SyntaxNode
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize(if_group, elif_groups, else_group, endif_line) ⇒ IfSection
Returns a new instance of IfSection.
128 129 130 131 132 133 |
# File 'lib/adlint/cpp/syntax.rb', line 128 def initialize(if_group, elif_groups, else_group, endif_line) @if_group = if_group @elif_groups = elif_groups @else_group = else_group @endif_line = endif_line end |
Instance Attribute Details
#elif_groups ⇒ Object (readonly)
Returns the value of attribute elif_groups.
136 137 138 |
# File 'lib/adlint/cpp/syntax.rb', line 136 def elif_groups @elif_groups end |
#else_group ⇒ Object (readonly)
Returns the value of attribute else_group.
137 138 139 |
# File 'lib/adlint/cpp/syntax.rb', line 137 def else_group @else_group end |
#endif_line ⇒ Object (readonly)
Returns the value of attribute endif_line.
138 139 140 |
# File 'lib/adlint/cpp/syntax.rb', line 138 def endif_line @endif_line end |
#if_group ⇒ Object (readonly)
Returns the value of attribute if_group.
135 136 137 |
# File 'lib/adlint/cpp/syntax.rb', line 135 def if_group @if_group end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
144 145 146 147 148 149 150 151 |
# File 'lib/adlint/cpp/syntax.rb', line 144 def inspect(indent = 0) [" " * indent + short_class_name, @if_group ? @if_group.inspect(indent + 1) : nil, @elif_groups ? @elif_groups.inspect(indent + 1) : nil, @else_group ? @else_group.inspect(indent + 1) : nil, @endif_line ? @endif_line.inspect(indent + 1) : nil ].compact.join("\n") end |
#location ⇒ Object
140 141 142 |
# File 'lib/adlint/cpp/syntax.rb', line 140 def location @if_group.location end |