Skip to content
This repository was archived by the owner on Sep 24, 2025. It is now read-only.

Interfaces

Trey Terrell edited this page May 28, 2015 · 1 revision

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

Clone this wiki locally