Class: RubyCop::Ruby::List
Direct Known Subclasses
Args, Array, MultiAssignmentList, Params, RescueParams, Statements, String, StringConcat
Instance Attribute Summary collapse
-
#elements ⇒ Object
readonly
Returns the value of attribute elements.
Instance Method Summary collapse
- #add(element) ⇒ Object
-
#initialize(elements = nil) ⇒ List
constructor
A new instance of List.
Methods inherited from Node
Constructor Details
Instance Attribute Details
#elements ⇒ Object (readonly)
Returns the value of attribute elements.
8 9 10 |
# File 'lib/ruby_cop/ruby/list.rb', line 8 def elements @elements end |
Instance Method Details
#add(element) ⇒ Object
10 11 12 |
# File 'lib/ruby_cop/ruby/list.rb', line 10 def add(element) @elements.push(element) end |