Module: Veto::Model

Defined in:
lib/veto/model.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
# File 'lib/veto/model.rb', line 3

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#errorsObject



25
26
27
# File 'lib/veto/model.rb', line 25

def errors
  validator.errors
end

#valid?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/veto/model.rb', line 17

def valid?
  validator.valid?(self)
end

#validate!Object



21
22
23
# File 'lib/veto/model.rb', line 21

def validate!
  validator.validate!(self)
end