Module: Ambit

Defined in:
lib/ambit.rb

Overview

This gem allows choose/fail (amb) style non-deterministic programming in Ruby

Author

Jim Wise (mailto:[email protected])

Copyright

Copyright (c) 2011 Jim Wise

License

2-clause BSD-Style (see LICENSE)

Defined Under Namespace

Classes: ChoicesExhausted, Generator

Constant Summary collapse

VERSION =
'0.11'
Default_Generator =

The default generator used by Ambit.choose, Ambit.fail!, et al. should not be used directly.

Generator.new

Class Method Summary collapse

Class Method Details

.method_missing(sym, *args, &block) ⇒ Object

forward method invocations on this module to the default Generator.



158
159
160
# File 'lib/ambit.rb', line 158

def self.method_missing(sym, *args, &block) # :nodoc:
  Ambit::Default_Generator.send(sym, *args, &block)
end

.trace(lvl = false) ⇒ Object

Turn on tracing (to standard error) of Ambit operations

See ``Watching Ambit Work'' in README.rdoc

The optional level argument sets the verbosity -- if not passed, each call to this method increases verbosity



145
146
147
# File 'lib/ambit.rb', line 145

def self.trace lvl = false
  Generator::trace lvl
end

.untraceObject

Turn off tracing (to standard error) of Ambit operations

See ``Watching Ambit Work'' in README.rdoc



153
154
155
# File 'lib/ambit.rb', line 153

def self.untrace
  Generator::untrace
end