Sha256: 27487fcc6e777a8b60b8b63cef04b7802e674bf930a541bda9e97d1844c7320c
Contents?: true
Size: 670 Bytes
Versions: 8
Compression:
Stored size: 670 Bytes
Contents
require 'fedux_org/stdlib/logic_converters/exceptions' module FeduxOrg module Stdlib module LogicConverters class YesNoConverter # @param [true,false] value # the logic value which should be converted # @return [String] # the converted value: true => yes, false => no, '' => nil def parse( value ) case value when true 'yes' when false 'no' when '' nil else raise FeduxOrg::Stdlib::LogicConverters::Exceptions::InvalidValue, "Unknown logic value \"#{value}\"." end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems