module RedminePluginKit

Constants

VERSION

Public Class Methods

false?(value) click to toggle source

false if false or nil

# File lib/redmine_plugin_kit.rb, line 25
def false?(value)
  !true?(value)
end
textarea_cols(text, min: 8, max: 20) click to toggle source
# File lib/redmine_plugin_kit.rb, line 29
def textarea_cols(text, min: 8, max: 20)
  [[min, text.to_s.length / 50].max, max].min
end
true?(value) click to toggle source
# File lib/redmine_plugin_kit.rb, line 17
def true?(value)
  return false if value.is_a? FalseClass
  return true if value.is_a?(TrueClass) || value.to_i == 1 || value.to_s.casecmp('true').zero?

  false
end