Class: KubeDSL::Validations::ValidationErrors
- Inherits:
-
Object
- Object
- KubeDSL::Validations::ValidationErrors
- Defined in:
- lib/kube-dsl/validations.rb
Instance Attribute Summary collapse
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Instance Method Summary collapse
- #add(field_name, msg) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize ⇒ ValidationErrors
constructor
A new instance of ValidationErrors.
Constructor Details
#initialize ⇒ ValidationErrors
Returns a new instance of ValidationErrors.
8 9 10 |
# File 'lib/kube-dsl/validations.rb', line 8 def initialize @messages = {} end |
Instance Attribute Details
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
6 7 8 |
# File 'lib/kube-dsl/validations.rb', line 6 def @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) [field_name] ||= [] [field_name] << msg end |
#empty? ⇒ Boolean
17 18 19 |
# File 'lib/kube-dsl/validations.rb', line 17 def empty? .empty? end |