Class: Idcf::Dns::Validators::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/idcf/dns/validators/base.rb

Overview

Base validator class

Direct Known Subclasses

Record, Template, Zone

Class Method Summary collapse

Class Method Details

.validate_attributes!(attributes, action = nil) ⇒ Object

Validate request attributes. If there are invalid attributes, error occurs.

Parameters:

  • attributes (Hash)

    request attributes

  • action (Symbol) (defaults to: nil)

    request method



16
17
18
19
20
21
22
# File 'lib/idcf/dns/validators/base.rb', line 16

def validate_attributes!(attributes, action = nil)
  validate_presence!(attributes, action)
  validate_absence!(attributes, action)
  attributes.each do |name, value|
    validate_attribute!(name, value)
  end
end