Class: HasDynamicColumns::DynamicColumnValidation

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/has_dynamic_columns/dynamic_column_validation.rb

Instance Method Summary collapse

Instance Method Details

#is_valid?(str) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
9
# File 'lib/has_dynamic_columns/dynamic_column_validation.rb', line 5

def is_valid?(str)
	matches = Regexp.new(self["regexp"]).match(str.to_s)

	return !matches.nil?
end