Class: CloudscrapeClient::Validate
- Inherits:
-
Object
- Object
- CloudscrapeClient::Validate
- Defined in:
- lib/cloudscrape_client/validate.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(response:) ⇒ Validate
constructor
A new instance of Validate.
- #validate ⇒ Object
Constructor Details
#initialize(response:) ⇒ Validate
Returns a new instance of Validate.
3 4 5 |
# File 'lib/cloudscrape_client/validate.rb', line 3 def initialize(response:) @response = response end |
Class Method Details
.to_proc ⇒ Object
7 8 9 |
# File 'lib/cloudscrape_client/validate.rb', line 7 def self.to_proc ->(response) { with(response) } end |
.with(response) ⇒ Object
11 12 13 |
# File 'lib/cloudscrape_client/validate.rb', line 11 def self.with(response) new(response: response).validate end |
Instance Method Details
#validate ⇒ Object
15 16 17 18 19 20 |
# File 'lib/cloudscrape_client/validate.rb', line 15 def validate fail CloudscrapeClient::InternalServerError, if internal_error? fail CloudscrapeClient::NotFound, if not_found? true end |