Class: YARD::Parser::Ruby::ConditionalNode

Inherits:
KeywordNode show all
Defined in:
lib/yard/parser/ruby/ast_node.rb

Managing node state collapse

Constructor Details

This class inherits a constructor from YARD::Parser::Ruby::AstNode

Instance Method Details

#conditionObject


498
# File 'lib/yard/parser/ruby/ast_node.rb', line 498

def condition; first end

#condition?Boolean

Returns:

  • (Boolean)

497
# File 'lib/yard/parser/ruby/ast_node.rb', line 497

def condition?; true end

#else_blockObject


501
502
503
504
# File 'lib/yard/parser/ruby/ast_node.rb', line 501

def else_block
  return unless self[2] && !cmod?
  self[2].type == :elsif ? self[2] : self[2][0]
end

#then_blockObject


499
# File 'lib/yard/parser/ruby/ast_node.rb', line 499

def then_block; self[1] end