Class: ErrorProne::PresenceRule

Inherits:
Object
  • Object
show all
Includes:
Rule
Defined in:
lib/error_prone.rb

Instance Attribute Summary

Attributes included from Rule

#field, #object, #value

Instance Method Summary collapse

Methods included from Rule

included, #initialize, #validate!

Instance Method Details

#messageObject



207
208
209
# File 'lib/error_prone.rb', line 207

def message
  :missing
end

#verify!Object



201
202
203
204
205
# File 'lib/error_prone.rb', line 201

def verify!
  [:nil?, :empty?].select { |method| value.respond_to?(method) }.none? { |method|
    value.send(method)
  }
end