Class: RSpock::AST::InteractionTransformation

Inherits:
ASTTransform::AbstractTransformation
  • Object
show all
Defined in:
lib/rspock/ast/interaction_transformation.rb

Defined Under Namespace

Classes: InteractionError

Instance Method Summary collapse

Instance Method Details

#interaction_node?(node) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
19
20
# File 'lib/rspock/ast/interaction_transformation.rb', line 16

def interaction_node?(node)
  return false if node.nil?

  node.type == :send && node.children[1] == :*
end

#run(node) ⇒ Object



9
10
11
12
13
14
# File 'lib/rspock/ast/interaction_transformation.rb', line 9

def run(node)
  return node unless interaction_node?(node)

  parse_node(node)
  transform_node
end