Revision 3b29bf46
Added by Marc Dequènes about 14 years ago
- ID 3b29bf46cc93e88a8e5b48353bfef3094234ed18
lib/cyborghood/cyborg/dsl.rb | ||
---|---|---|
@@task_wip == 0
|
||
end
|
||
|
||
def initialize(bot, name = nil, &block)
|
||
# the name MUST be unique
|
||
def initialize(bot, name, &block)
|
||
@bot = bot
|
||
@name = name
|
||
|
||
... | ... | |
end
|
||
end
|
||
|
||
def task(name = nil, &block)
|
||
# the name MUST be unique
|
||
def task(name, &block)
|
||
_add_subtask("task/#{name}") do |subtask|
|
||
self.class.new(@bot, name || @name, &block)
|
||
self.class.new(@bot, name, &block)
|
||
subtask.finish
|
||
end
|
||
end
|
Also available in: Unified diff
[fix] a task must have a name (and be unique, but this is not enforced yet)