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.
4399 4400 4401 4402 4403 |
# File 'lib/adlint/cc1/syntax.rb', line 4399 def initialize(expr, inits) super() @expression = expr @initializers = inits end |
Instance Attribute Details
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
4405 4406 4407 |
# File 'lib/adlint/cc1/syntax.rb', line 4405 def expression @expression end |
#initializers ⇒ Object (readonly)
Returns the value of attribute initializers.
4406 4407 4408 |
# File 'lib/adlint/cc1/syntax.rb', line 4406 def initializers @initializers end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
4423 4424 4425 |
# File 'lib/adlint/cc1/syntax.rb', line 4423 def inspect(indent = 0) " " * indent + short_class_name end |
#location ⇒ Object
4408 4409 4410 |
# File 'lib/adlint/cc1/syntax.rb', line 4408 def location head_location end |
#to_s ⇒ Object
4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 |
# File 'lib/adlint/cc1/syntax.rb', line 4412 def to_s case when @expression @expression.to_s when @initializers "{#{@initializers.map { |ini| ini.to_s }.join(",")}}" else "{}" end end |