Method: ChefAPI::Validator::Base#initialize

Defined in:
lib/chef-api/validators/base.rb

#initialize(attribute, options = {}) ⇒ Base

Create anew validator.

Parameters:

  • attribute (Symbol)

    the attribute to apply this validation on

  • options (Hash) (defaults to: {})

    the list of options passed in



23
24
25
26
# File 'lib/chef-api/validators/base.rb', line 23

def initialize(attribute, options = {})
  @attribute = attribute
  @options   = options.is_a?(Hash) ? options : {}
end