Class: EnvatoOptimiser::ImageResponseStatusCodeCheck
- Defined in:
- lib/envato_optimiser/checks/image_response_status_code_check.rb
Instance Method Summary collapse
-
#initialize(image_urls) ⇒ Nothing
constructor
Initialize an image response status code check.
-
#to_h ⇒ Hash
Format the image response status code results into a usable Hash.
Constructor Details
#initialize(image_urls) ⇒ Nothing
Initialize an image response status code check.
9 10 11 12 13 14 15 16 |
# File 'lib/envato_optimiser/checks/image_response_status_code_check.rb', line 9 def initialize(image_urls) @redirects = [] @not_found = [] @forbidden = [] @server_error = [] fetch_image_responses(image_urls) end |
Instance Method Details
#to_h ⇒ Hash
Format the image response status code results into a usable Hash.
21 22 23 24 25 26 27 28 |
# File 'lib/envato_optimiser/checks/image_response_status_code_check.rb', line 21 def to_h { :image_redirect_count => redirect_count, :image_not_found_count => not_found_count, :image_forbidden_count => forbidden_count, :image_server_error_count => server_error_count, } end |