Class: AdLint::Cpp::ElseStatement

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

Instance Attribute Summary collapse

Attributes inherited from ElseGroup

#keyword

Instance Method Summary collapse

Methods inherited from ElseGroup

#location

Methods inherited from SyntaxNode

#location, #short_class_name

Methods included from LocationHolder

#analysis_target?

Methods included from Visitable

#accept

Constructor Details

#initialize(keyword, group) ⇒ ElseStatement

Returns a new instance of ElseStatement.



275
276
277
278
# File 'lib/adlint/cpp/syntax.rb', line 275

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

Instance Attribute Details

#groupObject (readonly)

Returns the value of attribute group.



280
281
282
# File 'lib/adlint/cpp/syntax.rb', line 280

def group
  @group
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



282
283
284
285
# File 'lib/adlint/cpp/syntax.rb', line 282

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