Class: Crosstest::Psychic::Factories::HotReadTaskFactory

Inherits:
MagicTaskFactory show all
Defined in:
lib/crosstest/psychic/factories/hot_read_task_factory.rb

Constant Summary

Constants inherited from MagicTaskFactory

MagicTaskFactory::TASK_PRIORITY

Instance Attribute Summary

Attributes inherited from MagicTaskFactory

#hints, #known_tasks, #priority, #psychic, #tasks

Instance Method Summary collapse

Methods inherited from MagicTaskFactory

#known_task?, known_tasks, magic_env_var, magic_env_vars, magic_file, magic_file_patterns, #priority_for_task, register_task_factory, task, tasks

Constructor Details

#initialize(psychic, opts = {}) ⇒ HotReadTaskFactory

Returns a new instance of HotReadTaskFactory


7
8
9
10
11
# File 'lib/crosstest/psychic/factories/hot_read_task_factory.rb', line 7

def initialize(psychic, opts = {})
  super
  @tasks = psychic.hints.tasks || {}
  @known_tasks = @tasks.keys || {}
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)

13
14
15
# File 'lib/crosstest/psychic/factories/hot_read_task_factory.rb', line 13

def active?
  !@tasks.empty?
end

#command_for_task(task_alias) ⇒ Object


17
18
19
20
# File 'lib/crosstest/psychic/factories/hot_read_task_factory.rb', line 17

def command_for_task(task_alias)
  return @tasks[task_alias.to_s] if @tasks.include? task_alias.to_s
  super
end