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

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

Constant Summary

Instance Attribute Summary collapse

Managing node state collapse

Constructor Details

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

Instance Attribute Details

#docstringObject Also known as: comments Originally defined in class AstNode

Returns the value of attribute docstring

#docstring_hash_flagObject Also known as: comments_hash_flag Originally defined in class AstNode

Returns the value of attribute docstring_hash_flag

#docstring_rangeObject Also known as: comments_range Originally defined in class AstNode

Returns the value of attribute docstring_range

#fileString Originally defined in class AstNode

Returns the filename the node was parsed from

Returns:

  • (String)

    the filename the node was parsed from

#full_sourceString Originally defined in class AstNode

Returns the full source that the node was parsed from

Returns:

  • (String)

    the full source that the node was parsed from

#groupObject Originally defined in class AstNode

Deprecated.

Groups are now defined by directives

#line_rangeRange Originally defined in class AstNode

Returns the line range in #full_source represented by the node

Returns:

  • (Range)

    the line range in #full_source represented by the node

#parentAstNode? Originally defined in class AstNode

Returns the node's parent or nil if it is a root node.

Returns:

  • (AstNode, nil)

    the node's parent or nil if it is a root node.

#sourceString Originally defined in class AstNode

Returns the parse of #full_source that the node represents

Returns:

#source_rangeRange Originally defined in class AstNode

Returns the character range in #full_source represented by the node

Returns:

  • (Range)

    the character range in #full_source represented by the node

#typeSymbol Originally defined in class AstNode

Returns the node's unique symbolic type

Returns:

  • (Symbol)

    the node's unique symbolic type

Instance Method Details

#conditionObject



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

def condition; first end

#condition?Boolean

Returns:

  • (Boolean)


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

def condition?; true end

#else_blockObject



491
492
493
494
495
# File 'lib/yard/parser/ruby/ast_node.rb', line 491

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

#then_blockObject



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

def then_block; self[1] end