Class: VCAP::Quota::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/vcap/quota.rb

Direct Known Subclasses

RepQuota, SetQuota

Defined Under Namespace

Classes: ValidationError

Instance Method Summary collapse

Instance Method Details

#build_commandObject

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/vcap/quota.rb', line 18

def build_command
  raise NotImplementedError
end

#execute(command) ⇒ Object



22
23
24
25
# File 'lib/vcap/quota.rb', line 22

def execute(command)
  stdout = `#{command}`
  [$?, stdout]
end

#parse_result(result) ⇒ Object



27
28
29
# File 'lib/vcap/quota.rb', line 27

def parse_result(result)
  result
end

#runObject



7
8
9
10
11
12
# File 'lib/vcap/quota.rb', line 7

def run
  validate
  command = build_command
  result = execute(command)
  parse_result(result)
end

#validateObject



14
15
16
# File 'lib/vcap/quota.rb', line 14

def validate
  nil
end