Method: SyntaxTree::Params#===

Defined in:
lib/syntax_tree/node.rb

#===(other) ⇒ Object



8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
# File 'lib/syntax_tree/node.rb', line 8428

def ===(other)
  other.is_a?(Params) && ArrayMatch.call(requireds, other.requireds) &&
    optionals.length == other.optionals.length &&
    optionals
      .zip(other.optionals)
      .all? { |left, right| ArrayMatch.call(left, right) } &&
    rest === other.rest && ArrayMatch.call(posts, other.posts) &&
    keywords.length == other.keywords.length &&
    keywords
      .zip(other.keywords)
      .all? { |left, right| ArrayMatch.call(left, right) } &&
    keyword_rest === other.keyword_rest && block === other.block
end