Sha256: 803cf2ab31e32ecaa9cc4a7423ba1a00ebe033fa8b34944089fb10677b8ea25a
Contents?: true
Size: 671 Bytes
Versions: 8
Compression:
Stored size: 671 Bytes
Contents
require 'fedux_org/stdlib/logic_converters/exceptions' module FeduxOrg module Stdlib module LogicConverters class OnOffConverter # @param [true,false] value # the logic value which should be converted # @return [String] # the converted value: true => on, false => off, '' => nil def parse( value ) case value when true 'on' when false 'off' 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