Class: PuppetX::Relay::Agent::Job::Work

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/puppet_x/relay/agent/job/work.rb

Instance Method Summary collapse

Constructor Details

#initializeWork

Returns a new instance of Work.



12
13
14
# File 'lib/puppet_x/relay/agent/job/work.rb', line 12

def initialize
  @jobs = Set.new.compare_by_identity
end

Instance Method Details

#add(item, interval = 0) ⇒ Object

Parameters:

  • item (Base)
  • interval (Integer) (defaults to: 0)


18
19
20
21
22
# File 'lib/puppet_x/relay/agent/job/work.rb', line 18

def add(item, interval = 0)
  elim_disabled
  @jobs << item.to_job(interval)
  self
end

#each(&block) ⇒ Object



24
25
26
27
28
# File 'lib/puppet_x/relay/agent/job/work.rb', line 24

def each(&block)
  elim_disabled
  @jobs.each(&block)
  self
end