Class: AutomationObject::BluePrint::HashAdapter::Validators::Validate

Inherits:
Object
  • Object
show all
Defined in:
lib/automation_object/blue_print/hash_adapter/helpers/validators/validate.rb

Overview

Super-class for validators, contains base functionality Sub-classes must implement validate for the composite

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#error_messagesArray<String>

Returns array of error messages, default empty array

Returns:

  • (Array<String>)

    array of error messages, default empty array



15
16
17
# File 'lib/automation_object/blue_print/hash_adapter/helpers/validators/validate.rb', line 15

def error_messages
  @error_messages
end

Instance Method Details

#valid?Boolean

Returns whether or not validation passed or failed

Returns:

  • (Boolean)

    whether or not validation passed or failed



20
21
22
# File 'lib/automation_object/blue_print/hash_adapter/helpers/validators/validate.rb', line 20

def valid?
  error_messages.length.zero? ? true : false
end