Class: Dapp::Deployment::Config::Directive::Job

Inherits:
Base show all
Defined in:
lib/dapp/deployment/config/directive/job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#hostname_pattern

Methods inherited from Config::Directive::Base

#clone, #encode_with

Constructor Details

#initialize(*args) ⇒ Job

Returns a new instance of Job.



8
9
10
11
# File 'lib/dapp/deployment/config/directive/job.rb', line 8

def initialize(*args)
  super
  @_run = []
end

Instance Attribute Details

#_dimgObject (readonly)

Returns the value of attribute _dimg.



6
7
8
# File 'lib/dapp/deployment/config/directive/job.rb', line 6

def _dimg
  @_dimg
end

#_runObject (readonly)

Returns the value of attribute _run.



6
7
8
# File 'lib/dapp/deployment/config/directive/job.rb', line 6

def _run
  @_run
end

Instance Method Details

#dimg(name) ⇒ Object



17
18
19
# File 'lib/dapp/deployment/config/directive/job.rb', line 17

def dimg(name)
  sub_directive_eval { @_dimg = name }
end

#empty?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/dapp/deployment/config/directive/job.rb', line 21

def empty?
  _run.empty? && _dimg.nil?
end

#run(*args) ⇒ Object



13
14
15
# File 'lib/dapp/deployment/config/directive/job.rb', line 13

def run(*args)
  sub_directive_eval { @_run.concat(args.flatten) }
end