Method: Validator::Validator#initialize

Defined in:
lib/opennebula/flow/validator.rb

#initialize(opts = {}) ⇒ Validator

Returns a new instance of Validator.

Parameters:

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

    the options to validate a body

Options Hash (opts):

  • :default_values (Boolean)

    Set default values if the schema specifies it (if true)

  • :delete_extra_properties (Boolean)

    If the body contains properties not specified in the schema delete them from the body (if true) or raise an exception (if false)

  • :allow_extra_properties (Boolean)

    Allow properties not specified in the schema



72
73
74
75
76
77
78
# File 'lib/opennebula/flow/validator.rb', line 72

def initialize(opts={})
    @opts = {
        :default_values => true,
        :delete_extra_properties => false,
        :allow_extra_properties => false
    }.merge(opts)
end