Class: YARD::Parser::Ruby::ParameterNode
Managing node state
collapse
Instance Method Details
#block_param ⇒ Object
382
|
# File 'lib/yard/parser/ruby/ast_node.rb', line 382
def block_param; self[-1] ? self[-1][0] : nil end
|
#keyword_param ⇒ Object
390
|
# File 'lib/yard/parser/ruby/ast_node.rb', line 390
def keyword_param; YARD.ruby2? ? self[-2] : nil end
|
#optional_params ⇒ Object
383
384
385
386
387
388
389
|
# File 'lib/yard/parser/ruby/ast_node.rb', line 383
def optional_params
optional = self[1] || []
if self[-3] && self[-3][0] && self[-3][0].type == :default_arg
optional += self[-3]
end
optional.empty? ? nil : optional
end
|
#required_end_params ⇒ Object
380
|
# File 'lib/yard/parser/ruby/ast_node.rb', line 380
def required_end_params; self[3] end
|
#required_params ⇒ Object
379
|
# File 'lib/yard/parser/ruby/ast_node.rb', line 379
def required_params; self[0] end
|
#splat_param ⇒ Object
381
|
# File 'lib/yard/parser/ruby/ast_node.rb', line 381
def splat_param; self[2] ? self[2][0] : nil end
|