Module: ImproveYourCode::AST::SexpExtensions::ArgNodeBase
- Included in:
- ArgNode, BlockargNode, KwargNode, KwoptargNode, KwrestargNode, OptargNode, RestargNode, ShadowargNode
- Defined in:
- lib/improve_your_code/ast/sexp_extensions/arguments.rb
Instance Method Summary collapse
- #anonymous_splat? ⇒ Boolean
- #block? ⇒ Boolean
- #components ⇒ Object
- #marked_unused? ⇒ Boolean
- #name ⇒ Object
- #optional_argument? ⇒ Boolean
- #plain_name ⇒ Object
Instance Method Details
#anonymous_splat? ⇒ Boolean
27 28 29 |
# File 'lib/improve_your_code/ast/sexp_extensions/arguments.rb', line 27 def anonymous_splat? false end |
#block? ⇒ Boolean
19 20 21 |
# File 'lib/improve_your_code/ast/sexp_extensions/arguments.rb', line 19 def block? false end |
#components ⇒ Object
31 32 33 |
# File 'lib/improve_your_code/ast/sexp_extensions/arguments.rb', line 31 def components [self] end |
#marked_unused? ⇒ Boolean
11 12 13 |
# File 'lib/improve_your_code/ast/sexp_extensions/arguments.rb', line 11 def marked_unused? plain_name.start_with?('_') end |
#name ⇒ Object
7 8 9 |
# File 'lib/improve_your_code/ast/sexp_extensions/arguments.rb', line 7 def name children.first end |
#optional_argument? ⇒ Boolean
23 24 25 |
# File 'lib/improve_your_code/ast/sexp_extensions/arguments.rb', line 23 def optional_argument? false end |
#plain_name ⇒ Object
15 16 17 |
# File 'lib/improve_your_code/ast/sexp_extensions/arguments.rb', line 15 def plain_name name.to_s end |