Class: AdLint::Cpp::IdentifierList
- Inherits:
-
SyntaxNode
- Object
- SyntaxNode
- AdLint::Cpp::IdentifierList
- Defined in:
- lib/adlint/cpp/syntax.rb
Instance Attribute Summary collapse
-
#identifiers ⇒ Object
readonly
Returns the value of attribute identifiers.
Instance Method Summary collapse
-
#initialize(ids = []) ⇒ IdentifierList
constructor
A new instance of IdentifierList.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
- #push(id) ⇒ Object
Methods inherited from SyntaxNode
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize(ids = []) ⇒ IdentifierList
Returns a new instance of IdentifierList.
58 59 60 |
# File 'lib/adlint/cpp/syntax.rb', line 58 def initialize(ids = []) @identifiers = ids end |
Instance Attribute Details
#identifiers ⇒ Object (readonly)
Returns the value of attribute identifiers.
62 63 64 |
# File 'lib/adlint/cpp/syntax.rb', line 62 def identifiers @identifiers end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
73 74 75 76 |
# File 'lib/adlint/cpp/syntax.rb', line 73 def inspect(indent = 0) ([" " * indent + short_class_name] + @identifiers.map { |child| child.inspect }).join("\n") end |
#location ⇒ Object
69 70 71 |
# File 'lib/adlint/cpp/syntax.rb', line 69 def location @identifiers.first.location end |
#push(id) ⇒ Object
64 65 66 67 |
# File 'lib/adlint/cpp/syntax.rb', line 64 def push(id) @identifiers.push(id) self end |