Method: CSDL::Builder#_return

Defined in:
lib/csdl/builder.rb

#_return(&block) ⇒ AST::Node

Note:

The base Processor will not process return statement nodes, use InteractionFilterProcessor instead.

Wrap child nodes in a return statement scope.

Examples:

nodes = CSDL::Builder.new._return do
  condition("fb.content", :contains, "this is a string")
end
CSDL::InteractionFilterProcessor.new.process(nodes) # => 'return {fb.content contains "this is a string"}'

Yield Returns:

  • (AST::Node, Array<AST::Node>)

    An AST node or array of AST nodes to be wrapped by a :statement_scope node.

See Also:



126
127
128
# File 'lib/csdl/builder.rb', line 126

def _return(&block)
  s(:return, statement_scope(&block))
end