Class: CloudscrapeClient::Executions::Result

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

Defined Under Namespace

Classes: File

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(headers:, row:) ⇒ Result

Returns a new instance of Result.



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

def initialize(headers:, row:)
  @headers = headers
  @row = row
  build
end

Instance Attribute Details

#rowObject (readonly)

Returns the value of attribute row.



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

def row
  @row
end

Instance Method Details

#as_hashObject



20
21
22
# File 'lib/cloudscrape_client/executions/result.rb', line 20

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

#buildObject



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

def build
  as_hash.each(&define_method_for_header)
end