Class: WhatDyaReturn::AST::IfNode
- Inherits:
-
RuboCop::AST::IfNode
- Object
- RuboCop::AST::IfNode
- WhatDyaReturn::AST::IfNode
- Defined in:
- lib/what_dya_return/ast/node/if_node.rb
Overview
A node extension for ‘if` nodes.
Instance Method Summary collapse
Instance Method Details
#else_branch_reachable? ⇒ Boolean
35 36 37 |
# File 'lib/what_dya_return/ast/node/if_node.rb', line 35 def else_branch_reachable? ((if? || ternary? || elsif?) && condition.truthy_literal?.!) || (unless? && condition.falsey_literal?.!) end |
#if_branch_reachable? ⇒ Boolean
20 21 22 |
# File 'lib/what_dya_return/ast/node/if_node.rb', line 20 def if_branch_reachable? ((if? || ternary? || elsif?) && condition.falsey_literal?.!) || (unless? && condition.truthy_literal?.!) end |