Class: Hashira::Smells::Branches

Inherits:
Object
  • Object
show all
Defined in:
lib/hashira/smells/branches.rb

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ Branches

Returns a new instance of Branches.



6
7
8
# File 'lib/hashira/smells/branches.rb', line 6

def initialize(root)
  @root = root
end

Instance Method Details

#together?(nodes) ⇒ Boolean

Returns:

  • (Boolean)


10
# File 'lib/hashira/smells/branches.rb', line 10

def together?(nodes) = nodes.combination(2).any? { |left, right| meet?(trail(left), trail(right)) }