Module: Bosh::Cli::Validation

Included in:
ReleaseTarball, Stemcell
Defined in:
lib/cli/validation.rb

Instance Method Summary collapse

Instance Method Details

#errorsObject


8
9
10
# File 'lib/cli/validation.rb', line 8

def errors
  @errors ||= []
end

#reset_validationObject


24
25
26
27
# File 'lib/cli/validation.rb', line 24

def reset_validation
  @validated = nil
  @errors = []
end

#valid?(options = {}) ⇒ Boolean

Returns:

  • (Boolean)

12
13
14
15
# File 'lib/cli/validation.rb', line 12

def valid?(options = {})
  validate(options) unless @validated
  errors.empty?
end

#validate(options = {}) ⇒ Object


17
18
19
20
21
22
# File 'lib/cli/validation.rb', line 17

def validate(options = {})
  perform_validation(options)
rescue ValidationHalted
ensure
  @validated = true
end