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.



336
337
338
339
# File 'lib/prefab/criteria_evaluator.rb', line 336

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

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



322
323
324
# File 'lib/prefab/criteria_evaluator.rb', line 322

def error
  @error
end

#matchedObject (readonly)

Returns the value of attribute matched.



322
323
324
# File 'lib/prefab/criteria_evaluator.rb', line 322

def matched
  @matched
end

Class Method Details

.errorObject



332
333
334
# File 'lib/prefab/criteria_evaluator.rb', line 332

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

.matchedObject



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

def self.matched
  new(matched: true)
end

.not_matchedObject



328
329
330
# File 'lib/prefab/criteria_evaluator.rb', line 328

def self.not_matched
  new(matched: false)
end