Class: Deliver::AppScreenshotValidator::ValidationError

Inherits:
Object
  • Object
show all
Defined in:
deliver/lib/deliver/app_screenshot_validator.rb

Overview

A simple structure that holds error information as well as formatted error messages consistently

Constant Summary collapse

INVALID_SCREEN_SIZE =

Constants that can be given to type param

'Invalid screen size'.freeze
INVALID_FILE_EXTENSION =
'Invalid file extension'.freeze
FILE_EXTENSION_MISMATCH =
'File extension mismatches its image format'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type: nil, path: nil, debug_info: nil) ⇒ ValidationError



14
15
16
17
18
# File 'deliver/lib/deliver/app_screenshot_validator.rb', line 14

def initialize(type: nil, path: nil, debug_info: nil)
  @type = type
  @path = path
  @debug_info = debug_info
end

Instance Attribute Details

#debug_infoObject (readonly)

Returns the value of attribute debug_info.



12
13
14
# File 'deliver/lib/deliver/app_screenshot_validator.rb', line 12

def debug_info
  @debug_info
end

#pathObject (readonly)

Returns the value of attribute path.



12
13
14
# File 'deliver/lib/deliver/app_screenshot_validator.rb', line 12

def path
  @path
end

#typeObject (readonly)

Returns the value of attribute type.



12
13
14
# File 'deliver/lib/deliver/app_screenshot_validator.rb', line 12

def type
  @type
end

Instance Method Details

#inspectObject



24
25
26
# File 'deliver/lib/deliver/app_screenshot_validator.rb', line 24

def inspect
  "\"#{type}\""
end

#to_sObject



20
21
22
# File 'deliver/lib/deliver/app_screenshot_validator.rb', line 20

def to_s
  "🚫 Error: #{path} - #{type} (#{debug_info})"
end