Sha256: fc73cc7e190d7c32a2834ee94f1123cbe2e088d94f111d58bc164fbf4095c500

Contents?: true

Size: 531 Bytes

Versions: 1

Compression:

Stored size: 531 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

1 entries across 1 versions & 1 rubygems

Version Path
corelib-0.0.7 lib/corelib/boolean/false.rb