Class: Deliver::AppScreenshotValidator::ValidationError
- Inherits:
-
Object
- Object
- Deliver::AppScreenshotValidator::ValidationError
- Defined in:
- deliver/lib/deliver/app_screenshot_validator.rb
Overview
A simple structure that holds error information as well as formatted error messages consistently Set ‘to_skip` to `true` when just needing to skip uploading rather than causing a crash.
Constant Summary collapse
- INVALID_SCREEN_SIZE =
Constants that can be given to ‘type` param
'Invalid screen size'.freeze
- UNACCEPTABLE_DEVICE =
'Not an accepted App Store Connect device'.freeze
- INVALID_FILE_EXTENSION =
'Invalid file extension'.freeze
- FILE_EXTENSION_MISMATCH =
'File extension mismatches its image format'.freeze
Instance Attribute Summary collapse
-
#debug_info ⇒ Object
readonly
Returns the value of attribute debug_info.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#to_skip ⇒ Object
readonly
Returns the value of attribute to_skip.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type: nil, path: nil, debug_info: nil, to_skip: false) ⇒ ValidationError
constructor
A new instance of ValidationError.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(type: nil, path: nil, debug_info: nil, to_skip: false) ⇒ ValidationError
Returns a new instance of ValidationError.
16 17 18 19 20 21 |
# File 'deliver/lib/deliver/app_screenshot_validator.rb', line 16 def initialize(type: nil, path: nil, debug_info: nil, to_skip: false) @type = type @path = path @debug_info = debug_info @to_skip = to_skip end |
Instance Attribute Details
#debug_info ⇒ Object (readonly)
Returns the value of attribute debug_info.
14 15 16 |
# File 'deliver/lib/deliver/app_screenshot_validator.rb', line 14 def debug_info @debug_info end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
14 15 16 |
# File 'deliver/lib/deliver/app_screenshot_validator.rb', line 14 def path @path end |
#to_skip ⇒ Object (readonly)
Returns the value of attribute to_skip.
14 15 16 |
# File 'deliver/lib/deliver/app_screenshot_validator.rb', line 14 def to_skip @to_skip end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
14 15 16 |
# File 'deliver/lib/deliver/app_screenshot_validator.rb', line 14 def type @type end |
Instance Method Details
#inspect ⇒ Object
27 28 29 |
# File 'deliver/lib/deliver/app_screenshot_validator.rb', line 27 def inspect "\"#{type}\"" end |
#to_s ⇒ Object
23 24 25 |
# File 'deliver/lib/deliver/app_screenshot_validator.rb', line 23 def to_s "#{to_skip ? '🏃 Skipping' : '🚫 Error'}: #{path} - #{type} (#{debug_info})" end |