class DataMaps::When::Regex
Condition
to check for an regular expression
@since 0.0.1 @attr_reader @regex the given regex
Attributes
regex[R]
Public Instance Methods
after_initialize()
click to toggle source
After initialize callback
# File lib/data_maps/when/regex.rb, line 11 def after_initialize @regex = Regexp.new(option) end
execute(data)
click to toggle source
The check method to evaluate condition on given data
@param [mixed] data
# File lib/data_maps/when/regex.rb, line 18 def execute(data) !!@regex.match(data) end