Class: Bosh::Cli::JobCommandArgs

Inherits:
Struct
  • Object
show all
Defined in:
lib/cli/job_command_args.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ JobCommandArgs

Returns a new instance of JobCommandArgs.



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/cli/job_command_args.rb', line 3

def initialize(args)
  job = args.shift
  err('Please provide job name') if job.nil?
  job, id = job.split('/', 2)

  id = args.shift if id.nil?

  self.job = job
  self.id = id
  self.args = args
end

Instance Attribute Details

#argsObject

Returns the value of attribute args

Returns:

  • (Object)

    the current value of args



2
3
4
# File 'lib/cli/job_command_args.rb', line 2

def args
  @args
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



2
3
4
# File 'lib/cli/job_command_args.rb', line 2

def id
  @id
end

#jobObject

Returns the value of attribute job

Returns:

  • (Object)

    the current value of job



2
3
4
# File 'lib/cli/job_command_args.rb', line 2

def job
  @job
end

Instance Method Details

#indexObject



15
16
17
# File 'lib/cli/job_command_args.rb', line 15

def index
  id
end