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



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

def condition; first end

#condition?Boolean

Returns:

  • (Boolean)


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

def condition?; true end

#else_blockObject



450
451
452
453
454
# File 'lib/yard/parser/ruby/ast_node.rb', line 450

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

#then_blockObject



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

def then_block; self[1] end