Class: RequestEnvironmentRule

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
Redirector::RegexAttribute
Defined in:
app/models/request_environment_rule.rb

Instance Method Summary collapse

Methods included from Redirector::RegexAttribute

regex_attribute

Instance Method Details

#matches?(environment) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
18
19
20
21
# File 'app/models/request_environment_rule.rb', line 15

def matches?(environment)
  if environment_value_is_regex?
    environment[environment_key_name] && environment[environment_key_name] =~ environment_value_regex
  else
    environment[environment_key_name] == environment_value
  end
end