Class: Pod::Specification::Linter::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-core/specification/linter.rb

Overview

———————————————————————–#

Root spec validation helpers collapse

Root spec validation helpers collapse

Constructor Details

#initialize(type, message) ⇒ Result

Returns a new instance of Result.

Parameters:

  • type (Symbol)

    @see type

  • message (String)

    @see message



386
387
388
389
390
# File 'lib/cocoapods-core/specification/linter.rb', line 386

def initialize(type, message)
  @type    = type
  @message = message
  @platforms = []
end

Instance Attribute Details

#messageString (readonly)

Returns the message associated with result.

Returns:

  • (String)

    the message associated with result.



381
382
383
# File 'lib/cocoapods-core/specification/linter.rb', line 381

def message
  @message
end

#platformsArray<Platform> (readonly)

Returns the platforms where this result was generated.

Returns:

  • (Array<Platform>)

    the platforms where this result was generated.



395
396
397
# File 'lib/cocoapods-core/specification/linter.rb', line 395

def platforms
  @platforms
end

#typeSymbol (readonly)

Returns the type of result.

Returns:

  • (Symbol)

    the type of result.



377
378
379
# File 'lib/cocoapods-core/specification/linter.rb', line 377

def type
  @type
end

Instance Method Details

#to_sString

Returns a string representation suitable for UI output.

Returns:

  • (String)

    a string representation suitable for UI output.



399
400
401
402
403
404
405
406
# File 'lib/cocoapods-core/specification/linter.rb', line 399

def to_s
  r = "[#{type.to_s.upcase}] #{message}"
  if platforms != Specification::PLATFORMS
    platforms_names = platforms.uniq.map { |p| Platform.string_name(p) }
    r << " [#{platforms_names * ' - '}]" unless platforms.empty?
  end
  r
end