Parent

Methods

DataMapper::Sweatshop::UniqueWorker

Constants

MAX_TRIES

Public Class Methods

key_for(&block) click to toggle source

Use the sexp representation of the block as a unique key for the block If you copy and paste a block, it will still have the same key

return the unique key for the block

    # File lib/dm-sweatshop/unique.rb, line 78
78:       def self.key_for(&block)
79:         raise "You need to install ParseTree to use anonymous an anonymous unique (gem install ParseTree). In the mean time, explicitly declare a key: unique(:my_key) { ... }" unless Object::const_defined?("ParseTree")
80: 
81:         klass = Class.new
82:         name = "tmp"
83:         klass.send(:define_method, name, &block)
84:         self.parser ||= ParseTree.new(false)
85:         self.parser.parse_tree_for_method(klass, name).last
86:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.