Class: Pod::Specification::Linter::Results::Result
- Inherits:
-
Object
- Object
- Pod::Specification::Linter::Results::Result
- Defined in:
- lib/cocoapods-core/specification/linter/result.rb
Instance Attribute Summary collapse
-
#attribute_name ⇒ Object
readonly
@return[String] the name of the attribute associated with result.
-
#message ⇒ String
readonly
The message associated with result.
-
#platforms ⇒ Array<Platform>
readonly
The platforms where this result was generated.
-
#public_only ⇒ Boolean
(also: #public_only?)
readonly
Whether the result only applies to public specs.
-
#type ⇒ Symbol
readonly
The type of result.
Instance Method Summary collapse
-
#initialize(type, attribute_name, message, public_only = false) ⇒ Result
constructor
A new instance of Result.
-
#to_s ⇒ String
A string representation suitable for UI output.
Constructor Details
#initialize(type, attribute_name, message, public_only = false) ⇒ Result
Returns a new instance of Result.
28 29 30 31 32 33 34 |
# File 'lib/cocoapods-core/specification/linter/result.rb', line 28 def initialize(type, attribute_name, , public_only = false) @type = type @attribute_name = attribute_name @message = @public_only = public_only @platforms = [] end |
Instance Attribute Details
#attribute_name ⇒ Object (readonly)
@return[String] the name of the attribute associated with result.
14 15 16 |
# File 'lib/cocoapods-core/specification/linter/result.rb', line 14 def attribute_name @attribute_name end |
#message ⇒ String (readonly)
Returns the message associated with result.
18 19 20 |
# File 'lib/cocoapods-core/specification/linter/result.rb', line 18 def @message end |
#platforms ⇒ Array<Platform> (readonly)
Returns the platforms where this result was generated.
39 40 41 |
# File 'lib/cocoapods-core/specification/linter/result.rb', line 39 def platforms @platforms end |
#public_only ⇒ Boolean (readonly) Also known as: public_only?
Returns whether the result only applies to public specs.
22 23 24 |
# File 'lib/cocoapods-core/specification/linter/result.rb', line 22 def public_only @public_only end |
#type ⇒ Symbol (readonly)
Returns the type of result.
10 11 12 |
# File 'lib/cocoapods-core/specification/linter/result.rb', line 10 def type @type end |
Instance Method Details
#to_s ⇒ String
Returns a string representation suitable for UI output.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/cocoapods-core/specification/linter/result.rb', line 43 def to_s r = "[#{type.to_s.upcase}] [#{attribute_name}] #{}" if platforms != Specification::PLATFORMS platforms_names = platforms.uniq.map do |p| Platform.string_name(p) end r << " [#{platforms_names * ' - '}]" unless platforms.empty? end r end |