Class: FalseClass
Class Method Summary collapse
Instance Method Summary collapse
-
#to_yes_no(options = {}) ⇒ Object
Cap, Down, Up.
Class Method Details
.format_to_yes_no(value, options) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/corelib/boolean/false.rb', line 9 def self.format_to_yes_no(value, ) return value if !.has_key?(:format) #If format is unspecified, use the default format = [: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 |
Instance Method Details
#to_yes_no(options = {}) ⇒ Object
Cap, Down, Up
4 5 6 7 |
# File 'lib/corelib/boolean/false.rb', line 4 def to_yes_no(={}) value = .fetch(:if_no, "No") FalseClass.format_to_yes_no(value, ) end |