Class: AdLint::Cpp::ElifStatement

Inherits:
ElifGroup show all
Defined in:
lib/adlint/cpp/syntax.rb

Instance Attribute Summary collapse

Attributes inherited from ElifGroup

#keyword

Instance Method Summary collapse

Methods inherited from ElifGroup

#location

Methods inherited from SyntaxNode

#location, #short_class_name

Methods included from LocationHolder

#analysis_target?

Methods included from Visitable

#accept

Constructor Details

#initialize(keyword, expr, group) ⇒ ElifStatement

Returns a new instance of ElifStatement.



247
248
249
250
251
# File 'lib/adlint/cpp/syntax.rb', line 247

def initialize(keyword, expr, group)
  super(keyword)
  @expression = expr
  @group = group
end

Instance Attribute Details

#expressionObject

Returns the value of attribute expression.



253
254
255
# File 'lib/adlint/cpp/syntax.rb', line 253

def expression
  @expression
end

#groupObject (readonly)

Returns the value of attribute group.



254
255
256
# File 'lib/adlint/cpp/syntax.rb', line 254

def group
  @group
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



256
257
258
259
# File 'lib/adlint/cpp/syntax.rb', line 256

def inspect(indent = 0)
  [" " * indent + "#{short_class_name} #{@expression.inspect}",
    @group ? @group.inspect(indent + 1) : nil].compact.join("\n")
end