Class: KubeDSL::Validations::ValidationErrors

Inherits:
Object
  • Object
show all
Defined in:
lib/kube-dsl/validations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeValidationErrors

Returns a new instance of ValidationErrors.



8
9
10
# File 'lib/kube-dsl/validations.rb', line 8

def initialize
  @messages = {}
end

Instance Attribute Details

#messagesObject (readonly)

Returns the value of attribute messages.



6
7
8
# File 'lib/kube-dsl/validations.rb', line 6

def messages
  @messages
end

Instance Method Details

#add(field_name, msg) ⇒ Object



12
13
14
15
# File 'lib/kube-dsl/validations.rb', line 12

def add(field_name, msg)
  messages[field_name] ||= []
  messages[field_name] << msg
end

#empty?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/kube-dsl/validations.rb', line 17

def empty?
  messages.empty?
end