--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Yields a value to the block. The value is unique for each invocation with the same block. Alternatively, you may provide an explicit key to identify the block.
- !ruby/struct:SM::Flow::P 
  body: If a block with no parameter is supplied, unique keeps track of previous invocations, and will continue yielding until a unique value is generated. If a unique value is not generated after @UniqueWorker::MAX_TRIES@, an exception is raised.
- !ruby/struct:SM::Flow::P 
  body: ParseTree is required unless an explicit key is provided
- !ruby/struct:SM::Flow::VERB 
  body: "  (1..3).collect { unique {|x| x }}     # =&gt; [0, 1, 2]\n  (1..3).collect { unique {|x| x + 1 }} # =&gt; [1, 2, 3]\n  (1..3).collect { unique {|x| x }}     # =&gt; [3, 4, 5] # Continued on from above\n  (1..3).collect { unique(:a) {|x| x }} # =&gt; [0, 1, 2] # Explicit key overrides block identity\n\n  a = [1, 1, 1, 2, 2, 3]\n  (1..3).collect { unique { a.shift }}  # =&gt; [1, 2, 3]\n  (1..3).collect { unique { 1 }}        # raises TooManyTriesException\n"
- !ruby/struct:SM::Flow::P 
  body: return &lt;Object&gt; the return value of the block
full_name: DataMapper::Sweatshop::Unique#unique
is_singleton: false
name: unique
params: (key = nil, &block)
visibility: public
