Module: Faire::Validator

Defined in:
lib/faire/validator.rb

Instance Method Summary collapse

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/faire/validator.rb', line 11

def valid?
  @valid == true
end

#validateObject



7
8
9
# File 'lib/faire/validator.rb', line 7

def validate
  @valid = self.class.required_inputs.all?{|object| self.public_send(object.name) }
end

#validate!Object



3
4
5
# File 'lib/faire/validator.rb', line 3

def validate!
  validate || (raise Error::RequiredParametersMissing, "required parameters missing")
end