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.



8
9
10
# File 'lib/cloudscrape_client/executions/results.rb', line 8

def initialize(response:)
  @response = response
end

Instance Attribute Details

#responseObject (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_hashObject



12
13
14
# File 'lib/cloudscrape_client/executions/results.rb', line 12

def as_hash
  collection.map(&:as_hash)
end

#collectionObject



16
17
18
# File 'lib/cloudscrape_client/executions/results.rb', line 16

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