Module: YiffSpace::Extensions::String::TruthyFalsy

Included in:
String
Defined in:
lib/yiffspace/extensions/string/truthy_falsy.rb

Instance Method Summary collapse

Instance Method Details

#falsy?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/yiffspace/extensions/string/truthy_falsy.rb', line 11

def falsy?
  match?(/\A(false|f|no|n|off|0)\z/i)
end

#truthy?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/yiffspace/extensions/string/truthy_falsy.rb', line 7

def truthy?
  match?(/\A(true|t|yes|y|on|1)\z/i)
end