Class: AdLint::Cc1::Initializer
- Inherits:
-
SyntaxNode
- Object
- SyntaxNode
- AdLint::Cc1::Initializer
- Defined in:
- lib/adlint/cc1/syntax.rb
Instance Attribute Summary collapse
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
-
#initializers ⇒ Object
readonly
Returns the value of attribute initializers.
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary collapse
-
#initialize(expr, inits) ⇒ Initializer
constructor
A new instance of Initializer.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
- #to_s ⇒ Object
Methods inherited from SyntaxNode
#head_location, #short_class_name, #tail_location
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize(expr, inits) ⇒ Initializer
Returns a new instance of Initializer.
4418 4419 4420 4421 4422 |
# File 'lib/adlint/cc1/syntax.rb', line 4418 def initialize(expr, inits) super() @expression = expr @initializers = inits end |
Instance Attribute Details
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
4424 4425 4426 |
# File 'lib/adlint/cc1/syntax.rb', line 4424 def expression @expression end |
#initializers ⇒ Object (readonly)
Returns the value of attribute initializers.
4425 4426 4427 |
# File 'lib/adlint/cc1/syntax.rb', line 4425 def initializers @initializers end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
4442 4443 4444 |
# File 'lib/adlint/cc1/syntax.rb', line 4442 def inspect(indent = 0) " " * indent + short_class_name end |
#location ⇒ Object
4427 4428 4429 |
# File 'lib/adlint/cc1/syntax.rb', line 4427 def location head_location end |
#to_s ⇒ Object
4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 |
# File 'lib/adlint/cc1/syntax.rb', line 4431 def to_s case when @expression @expression.to_s when @initializers "{#{@initializers.map { |ini| ini.to_s }.join(",")}}" else "{}" end end |