Class: AdLint::Cpp::IfStatement
- Inherits:
-
IfGroup
- Object
- SyntaxNode
- IfGroup
- AdLint::Cpp::IfStatement
- Defined in:
- lib/adlint/cpp/syntax.rb
Instance Attribute Summary collapse
-
#expression ⇒ Object
Returns the value of attribute expression.
-
#group ⇒ Object
readonly
Returns the value of attribute group.
Attributes inherited from IfGroup
Instance Method Summary collapse
-
#initialize(keyword, expr, group) ⇒ IfStatement
constructor
A new instance of IfStatement.
- #inspect(indent = 0) ⇒ Object
Methods inherited from IfGroup
Methods inherited from SyntaxNode
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize(keyword, expr, group) ⇒ IfStatement
Returns a new instance of IfStatement.
167 168 169 170 171 |
# File 'lib/adlint/cpp/syntax.rb', line 167 def initialize(keyword, expr, group) super(keyword) @expression = expr @group = group end |
Instance Attribute Details
#expression ⇒ Object
Returns the value of attribute expression.
173 174 175 |
# File 'lib/adlint/cpp/syntax.rb', line 173 def expression @expression end |
#group ⇒ Object (readonly)
Returns the value of attribute group.
174 175 176 |
# File 'lib/adlint/cpp/syntax.rb', line 174 def group @group end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
176 177 178 179 180 |
# File 'lib/adlint/cpp/syntax.rb', line 176 def inspect(indent = 0) [" " * indent + "#{short_class_name}", @expression.inspect(indent + 1), @group ? @group.inspect(indent + 1) : nil].compact.join("\n") end |