Class: Anodator::Validator::PresenceValidator

Inherits:
Base
  • Object
show all
Defined in:
lib/anodator/validator/presence_validator.rb

Overview

presence validator

This is the Validator to validate whether the value is present.

Instance Attribute Summary

Attributes inherited from Base

#options, #target

Instance Method Summary collapse

Methods inherited from Base

#allow_blank?, #argument_value_at, default_options, #description, #initialize, #target_value, #to_s, #valid?, valid_option_keys, #validate_configuration, values, values=

Constructor Details

This class inherits a constructor from Anodator::Validator::Base

Instance Method Details

#validateObject



9
10
11
# File 'lib/anodator/validator/presence_validator.rb', line 9

def validate
  return !target_value.split(//).size.zero?
end