Class: Pod::Specification::Linter::Results
- Inherits:
-
Object
- Object
- Pod::Specification::Linter::Results
- Includes:
- Enumerable
- Defined in:
- lib/cocoapods-core/specification/linter/result.rb
Defined Under Namespace
Classes: Result
Instance Attribute Summary collapse
-
#consumer ⇒ Specification::Consumer
The current consumer.
-
#results ⇒ Array<Result>
readonly
private
All of the generated results.
Instance Method Summary collapse
-
#add_error(attribute_name, message, public_only = false) ⇒ void
Adds an error result with the given message.
-
#add_result(type, attribute_name, message, public_only) ⇒ void
private
Adds a result of the given type with the given message.
-
#add_warning(attribute_name, message, public_only = false) ⇒ void
Adds a warning result with the given message.
- #each ⇒ Object
- #empty? ⇒ Boolean
-
#initialize ⇒ Results
constructor
A new instance of Results.
Constructor Details
#initialize ⇒ Results
Returns a new instance of Results.
55 56 57 58 |
# File 'lib/cocoapods-core/specification/linter/result.rb', line 55 def initialize @results = [] @consumer = nil end |
Instance Attribute Details
#consumer ⇒ Specification::Consumer
Returns the current consumer.
72 73 74 |
# File 'lib/cocoapods-core/specification/linter/result.rb', line 72 def consumer @consumer end |
#results ⇒ Array<Result> (readonly, private)
Returns all of the generated results.
100 101 102 |
# File 'lib/cocoapods-core/specification/linter/result.rb', line 100 def results @results end |
Instance Method Details
#add_error(attribute_name, message, public_only = false) ⇒ void
This method returns an undefined value.
Adds an error result with the given message.
81 82 83 |
# File 'lib/cocoapods-core/specification/linter/result.rb', line 81 def add_error(attribute_name, , public_only = false) add_result(:error, attribute_name, , public_only) end |
#add_result(type, attribute_name, message, public_only) ⇒ void (private)
This method returns an undefined value.
Adds a result of the given type with the given message. If there is a current platform it is added to the result. If a result with the same type and the same message is already available the current platform is added to the existing result.
115 116 117 118 119 120 121 122 123 124 |
# File 'lib/cocoapods-core/specification/linter/result.rb', line 115 def add_result(type, attribute_name, , public_only) result = results.find do |r| r.type == type && r.attribute_name == attribute_name && r. == && r.public_only? == public_only end unless result result = Result.new(type, attribute_name, , public_only) results << result end result.platforms << @consumer.platform_name if @consumer end |
#add_warning(attribute_name, message, public_only = false) ⇒ void
This method returns an undefined value.
Adds a warning result with the given message.
92 93 94 |
# File 'lib/cocoapods-core/specification/linter/result.rb', line 92 def add_warning(attribute_name, , public_only = false) add_result(:warning, attribute_name, , public_only) end |
#each ⇒ Object
62 63 64 |
# File 'lib/cocoapods-core/specification/linter/result.rb', line 62 def each results.each { |r| yield r } end |
#empty? ⇒ Boolean
66 67 68 |
# File 'lib/cocoapods-core/specification/linter/result.rb', line 66 def empty? results.empty? end |