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


7
8
9
# File 'lib/diaspora_federation/validators/rules/not_nil.rb', line 7

def error_key
  :not_nil
end

#paramsHash

This rule has no params.


18
19
20
# File 'lib/diaspora_federation/validators/rules/not_nil.rb', line 18

def params
  {}
end

#valid_value?(value) ⇒ Boolean

Determines if value is not nil


12
13
14
# File 'lib/diaspora_federation/validators/rules/not_nil.rb', line 12

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