Class: Validatable::Validator

Inherits:
Object
  • Object
show all
Defined in:
lib/railz_lite/models/validatable.rb

Instance Method Summary collapse

Instance Method Details

#saveObject



11
12
13
# File 'lib/railz_lite/models/validatable.rb', line 11

def save
  @validation_callbacks.each { |method| send(:method) }
end

#validate(method_name, *args) ⇒ Object



7
8
9
# File 'lib/railz_lite/models/validatable.rb', line 7

def validate(method_name, *args)
  @validation_callbacks << method_name
end

#validation_callbacksObject



3
4
5
# File 'lib/railz_lite/models/validatable.rb', line 3

def validation_callbacks
  @validation_callbacks ||= []
end