Sha256: c61d7298eee1beaf5f12e20441bad7137ae9a4f0196d7ad1ca08a8f1e63d3fd2
Contents?: true
Size: 547 Bytes
Versions: 5
Compression:
Stored size: 547 Bytes
Contents
class FalseClass #Cap, Down, Up def to_yes_no(options={}) value = options.fetch(:if_no, "No") FalseClass.format_to_yes_no(value, options) end def self.format_to_yes_no(value, options) return value if !options.has_key?(:format) #If format is unspecified, use the default format = options[:format] return value.upcase if format == "Up" return value.downcase if format == "Down" value.capitalize #format has to be capital at this point (or an invalid format, so we will assume capital) end end
Version data entries
5 entries across 5 versions & 1 rubygems