Module: Jets::Util::Truthy

Instance Method Summary collapse

Instance Method Details

#truthy?(value) ⇒ Boolean

Allows use non-truthy values like

n no false off null nil 0

Returns:

  • (Boolean)


5
6
7
# File 'lib/jets/util/truthy.rb', line 5

def truthy?(value)
  %w[y yes true on 1].include?(value.to_s.downcase)
end