Method: VirtualKeywords::RewrittenKeywords#call_until
- Defined in:
- lib/virtual_keywords/rewritten_keywords.rb
#call_until(caller_object, condition, body) ⇒ Object
Call an “until” virtual block in place of an “until” expression. Unlike unless, until IS a node in the AST (it doesn’t turn into while not) For now, I’m passing this inconsistency through to the client. A later modification of this gem may fold while and until into one thing for consistency.
Arguments:
caller_object: (Object) the object whose method this is being called in.
condition: (Proc) The condition of the until expression.
body: (Proc) The body of the until expression (which is normally
executed repeatedly)
Raises:
RewriteLambdaNotProvided if no "until" lambda is available.
163 164 165 166 |
# File 'lib/virtual_keywords/rewritten_keywords.rb', line 163 def call_until(caller_object, condition, body) until_lambda = lambda_or_raise(caller_object, :until) until_lambda.call(condition, body) end |