class Annotate::Helpers
Class for holding helper methods. Done to make lib/annotate.rb less bloated.
Public Class Methods
fallback(*args)
click to toggle source
# File lib/annotate/helpers.rb, line 21 def fallback(*args) args.detect(&:present?) end
include_models?()
click to toggle source
# File lib/annotate/helpers.rb, line 13 def include_models? ENV['models'] =~ Constants::TRUE_RE end
include_routes?()
click to toggle source
# File lib/annotate/helpers.rb, line 9 def include_routes? ENV['routes'] =~ Constants::TRUE_RE end
reset_options(options)
click to toggle source
# File lib/annotate/helpers.rb, line 25 def reset_options(options) options.flatten.each { |key| ENV[key.to_s] = nil } end
skip_on_migration?()
click to toggle source
# File lib/annotate/helpers.rb, line 5 def skip_on_migration? ENV['ANNOTATE_SKIP_ON_DB_MIGRATE'] =~ Constants::TRUE_RE || ENV['skip_on_db_migrate'] =~ Constants::TRUE_RE end
true?(val)
click to toggle source
# File lib/annotate/helpers.rb, line 17 def true?(val) val.present? && Constants::TRUE_RE.match?(val) end