class PleaseRun::Configurable::FacetDSL

A DSL for describing a facet.

For example:

Facet.new(:temperature, "The temperature value") do
  validate do |v|
    fail "Temperature must be a number" unless v.is_a?(Numeric)
  end
  munge do |v|
    Float(v)
  end
end

Both validation and munge blocks are optional.

The ‘validate’ block is expcted to fail if the value given to the facet is not valid.

The ‘munge’ block is intended to help you coerce a value. For example, if you take “1234” from the user input (for example, as a command line flag value), you could use ‘munge’ to convert it to a number, as above.

Munge is invoked before validation. Munge can fail if an invalid value is given.