Class: Gitlab::Ci::EnvironmentMatcher
- Inherits:
-
Object
- Object
- Gitlab::Ci::EnvironmentMatcher
- Defined in:
- lib/gitlab/ci/environment_matcher.rb
Instance Method Summary collapse
-
#initialize(pattern) ⇒ EnvironmentMatcher
constructor
A new instance of EnvironmentMatcher.
- #match?(environment) ⇒ Boolean
Constructor Details
#initialize(pattern) ⇒ EnvironmentMatcher
Returns a new instance of EnvironmentMatcher.
6 7 8 |
# File 'lib/gitlab/ci/environment_matcher.rb', line 6 def initialize(pattern) @pattern = pattern end |
Instance Method Details
#match?(environment) ⇒ Boolean
10 11 12 13 14 |
# File 'lib/gitlab/ci/environment_matcher.rb', line 10 def match?(environment) return false if pattern.blank? exact_match?(environment) || wildcard_match?(environment) end |