Class: Prefab::CriteriaEvaluator::MatchResult

Inherits:
Object
  • Object
show all
Defined in:
lib/prefab/criteria_evaluator.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(matched:, error: false) ⇒ MatchResult

Returns a new instance of MatchResult.



338
339
340
341
# File 'lib/prefab/criteria_evaluator.rb', line 338

def initialize(matched:, error: false)
  @matched = matched
  @error = error
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



324
325
326
# File 'lib/prefab/criteria_evaluator.rb', line 324

def error
  @error
end

#matchedObject (readonly)

Returns the value of attribute matched.



324
325
326
# File 'lib/prefab/criteria_evaluator.rb', line 324

def matched
  @matched
end

Class Method Details

.errorObject



334
335
336
# File 'lib/prefab/criteria_evaluator.rb', line 334

def self.error
  new(matched: false, error: true)
end

.matchedObject



326
327
328
# File 'lib/prefab/criteria_evaluator.rb', line 326

def self.matched
  new(matched: true)
end

.not_matchedObject



330
331
332
# File 'lib/prefab/criteria_evaluator.rb', line 330

def self.not_matched
  new(matched: false)
end