Class: ProMotion::Validator

Inherits:
Object
  • Object
show all
Defined in:
lib/ProMotion/XLForm/validators/validator.rb

Direct Known Subclasses

RegexValidator

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#messageObject

Returns the value of attribute message.



3
4
5
# File 'lib/ProMotion/XLForm/validators/validator.rb', line 3

def message
  @message
end

Instance Method Details

#isValid(row) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/ProMotion/XLForm/validators/validator.rb', line 5

def isValid(row)
  is_valid = nil
  is_valid = valid?(row) if self.respond_to?(:valid?)

  return nil if is_valid.nil?
  XLFormValidationStatus.formValidationStatusWithMsg(@message, status: is_valid, rowDescriptor: row)
end

#valid?(row) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/ProMotion/XLForm/validators/validator.rb', line 13

def valid?(row)
  mp "You have to override valid?", force_color: :red
end