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.
5 6 7 |
# File 'lib/cloudscrape_client/validate.rb', line 5 def initialize(response:) @response = response end |
Class Method Details
.to_proc ⇒ Object
9 10 11 |
# File 'lib/cloudscrape_client/validate.rb', line 9 def self.to_proc ->(response) { with(response) } end |
.with(response) ⇒ Object
13 14 15 |
# File 'lib/cloudscrape_client/validate.rb', line 13 def self.with(response) new(response: response).validate end |
Instance Method Details
#validate ⇒ Object
17 18 19 20 21 22 |
# File 'lib/cloudscrape_client/validate.rb', line 17 def validate raise CloudscrapeClient::InternalServerError, if internal_error? raise CloudscrapeClient::NotFound, if not_found? true end |