Module: Sequel::Plugins::NotNaughty::ClassMethods

Defined in:
lib/sequel_notnaughty.rb

Overview

Ensures API compatibility.

Instance Method Summary collapse

Instance Method Details

#has_validations?Boolean

:nodoc:

Returns:

  • (Boolean)


59
60
61
# File 'lib/sequel_notnaughty.rb', line 59

def has_validations?() #:nodoc:
  validator.has_validations?
end

#validate(instance) ⇒ Object

:nodoc:



62
63
64
# File 'lib/sequel_notnaughty.rb', line 62

def validate(instance) #:nodoc:
  validator.invoke instance
end

#validationsObject

:nodoc:



53
54
55
56
57
58
# File 'lib/sequel_notnaughty.rb', line 53

def validations #:nodoc:
  validator.states.
  inject({}) do |validations, state_with_name|
    validations.merge(state_with_name[1].validations) {|k,o,n| o|n}
  end
end