Class: CloudscrapeClient::Executions::Results

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudscrape_client/executions/results.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response:) ⇒ Results

Returns a new instance of Results.



6
7
8
# File 'lib/cloudscrape_client/executions/results.rb', line 6

def initialize(response:)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



4
5
6
# File 'lib/cloudscrape_client/executions/results.rb', line 4

def response
  @response
end

Instance Method Details

#as_hashObject



10
11
12
# File 'lib/cloudscrape_client/executions/results.rb', line 10

def as_hash
  collection.map(&:as_hash)
end

#collectionObject



14
15
16
# File 'lib/cloudscrape_client/executions/results.rb', line 14

def collection
  response.fetch(:rows, [[]]).map(&result)
end