Class: CloudscrapeClient::Executions::Results
- Inherits:
-
Object
- Object
- CloudscrapeClient::Executions::Results
- Defined in:
- lib/cloudscrape_client/executions/results.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #as_hash ⇒ Object
- #collection ⇒ Object
-
#initialize(response:) ⇒ Results
constructor
A new instance of Results.
Constructor Details
#initialize(response:) ⇒ Results
Returns a new instance of Results.
8 9 10 |
# File 'lib/cloudscrape_client/executions/results.rb', line 8 def initialize(response:) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/cloudscrape_client/executions/results.rb', line 6 def response @response end |
Instance Method Details
#as_hash ⇒ Object
12 13 14 |
# File 'lib/cloudscrape_client/executions/results.rb', line 12 def as_hash collection.map(&:as_hash) end |
#collection ⇒ Object
16 17 18 |
# File 'lib/cloudscrape_client/executions/results.rb', line 16 def collection response.fetch(:rows, [[]]).map(&result) end |