Interfaces - OregonDigital/oregondigital_2 GitHub Wiki

Below is documentation of some interfaces that Oregon Digital depends on.

Validators

A property validator comes from ComposedValidations. Its interface looks like this:

class Validator
  # @param [Object] value A value to check the validity of.
  # @return [True, False] Whether or not the value is valid.
  def valid_value?(value)
  end
  
  # @return A message to display when a value is not valid.
  def message
  end

Controlled Vocabulary

A controlled vocabulary is a Validator which has a label and a description.

class ControlledVocabulary
  # @return A descriptive label for this controlled vocabulary.
  def label
  end

  # @return A description of what this controlled vocabulary consists of.
  def description
  end

  # @see Validator#valid_value?
  def valid_value?; end

  # @see Validator#message
  def message; end