module RocketGate::Validatable::ClassMethods

Public Instance Methods

validatable(*args) click to toggle source
# File lib/rocketgate/validatable.rb, line 3
def validatable(*args)
  args.each do |attribute|
    if self.new.respond_to?(attribute)
      validatable_attributes << attribute
    else
      raise RocketGate::ValidationError.new("Invalid attribute: #{attribute}")
    end
  end
end
validatable_attributes() click to toggle source
# File lib/rocketgate/validatable.rb, line 13
def validatable_attributes
  @validatable_attributes ||= []
end