Class: CloudscrapeClient::Executions::Result

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response:) ⇒ Result

Returns a new instance of Result.



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

def initialize(response:)
  @response = response
  build
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



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

def response
  @response
end

Instance Method Details

#as_hashObject



15
16
17
# File 'lib/cloudscrape_client/executions/result.rb', line 15

def as_hash
  @as_hash ||= Hash[headers.zip(rows)]
end

#buildObject



11
12
13
# File 'lib/cloudscrape_client/executions/result.rb', line 11

def build
  as_hash.each(&define_method_for_header)
end