Module: Atlas::Validations::ClassMethods

Defined in:
lib/atlas/mixins/validations.rb

Constant Summary collapse

@@required_attributes =
{}

Instance Method Summary collapse

Instance Method Details

#required_attributesObject



28
29
30
# File 'lib/atlas/mixins/validations.rb', line 28

def required_attributes
  @@required_attributes
end

#requires(*args) ⇒ Object



24
25
26
# File 'lib/atlas/mixins/validations.rb', line 24

def requires(*args)
  args.each { |attr| (@@required_attributes[name] ||= []) << attr }
end