Class: CloudscrapeClient::Executions::Get

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response:) ⇒ Get

Returns a new instance of Get.



6
7
8
# File 'lib/cloudscrape_client/executions/get.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/get.rb', line 4

def response
  @response
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/cloudscrape_client/executions/get.rb', line 22

def failed?
  %w(FAILED).include?(state)
end

#ok?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/cloudscrape_client/executions/get.rb', line 30

def ok?
  %w(OK).include?(state)
end

#pending?Boolean

Returns:

  • (Boolean)


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

def pending?
  %w(PENDING).include?(state)
end

#queued?Boolean

Returns:

  • (Boolean)


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

def queued?
  %w(QUEUED).include?(state)
end

#running?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/cloudscrape_client/executions/get.rb', line 18

def running?
  %w(RUNNING).include?(state)
end

#stateObject



34
35
36
# File 'lib/cloudscrape_client/executions/get.rb', line 34

def state
  response.fetch(:state)
end

#stopped?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/cloudscrape_client/executions/get.rb', line 26

def stopped?
  %w(STOPPED).include?(state)
end