Class: Validation::Rule::NotNil

Inherits:
Object
  • Object
show all
Defined in:
lib/diaspora_federation/validators/rules/not_nil.rb

Overview

Validates that a property is not nil

Instance Method Summary collapse

Instance Method Details

#error_keySymbol

The error key for this rule

Returns:

  • (Symbol)

    error key



9
10
11
# File 'lib/diaspora_federation/validators/rules/not_nil.rb', line 9

def error_key
  :not_nil
end

#paramsHash

This rule has no params.

Returns:

  • (Hash)

    params



20
21
22
# File 'lib/diaspora_federation/validators/rules/not_nil.rb', line 20

def params
  {}
end

#valid_value?(value) ⇒ Boolean

Determines if value is not nil

Returns:



14
15
16
# File 'lib/diaspora_federation/validators/rules/not_nil.rb', line 14

def valid_value?(value)
  !value.nil?
end