Interfaces - OregonDigital/oregondigital_2 GitHub Wiki

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


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)
  # @return A message to display when a value is not valid.
  def message

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

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

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

  # @see Validator#message
  def message; end