Class: SmartCore::Schema::Checker::Rules::Verifier::Result Private

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/smart_core/schema/checker/rules/verifier/result.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rule) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



25
26
27
28
# File 'lib/smart_core/schema/checker/rules/verifier/result.rb', line 25

def initialize(rule)
  @rule = rule
  @results = []
end

Instance Attribute Details

#resultsArray<SmartCore::Schema::Checker::Rules::Result::Base> (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

Since:

  • 0.1.0



13
14
15
# File 'lib/smart_core/schema/checker/rules/verifier/result.rb', line 13

def results
  @results
end

#ruleSmartCore::Schema::Checker::Rules::Base (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

Since:

  • 0.1.0



19
20
21
# File 'lib/smart_core/schema/checker/rules/verifier/result.rb', line 19

def rule
  @rule
end

Instance Method Details

#add(result) ⇒ result Also known as: <<

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

Returns:

  • (result)

Since:

  • 0.1.0



43
44
45
# File 'lib/smart_core/schema/checker/rules/verifier/result.rb', line 43

def add(result)
  result.tap { results << result }
end

#each(&block) {|result| ... } ⇒ Enumerable Also known as: each_result

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • block (Block)

Yields:

  • (result)

Yield Parameters:

Returns:

  • (Enumerable)

Since:

  • 0.1.0



55
56
57
# File 'lib/smart_core/schema/checker/rules/verifier/result.rb', line 55

def each(&block)
  block_given? ? results.each(&block) : results.each
end

#failure?Boolean

Returns:

  • (Boolean)

Since:

  • 0.1.0



72
73
74
# File 'lib/smart_core/schema/checker/rules/verifier/result.rb', line 72

def failure?
  results.all?(&:failure?)
end

#keyString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)

Since:

  • 0.1.0



34
35
36
# File 'lib/smart_core/schema/checker/rules/verifier/result.rb', line 34

def key
  rule.schema_key
end

#success?Boolean

Returns:

  • (Boolean)

Since:

  • 0.1.0



64
65
66
# File 'lib/smart_core/schema/checker/rules/verifier/result.rb', line 64

def success?
  results.all?(&:success?)
end