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.



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

def response
  @response
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/cloudscrape_client/executions/get.rb', line 24

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

#ok?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/cloudscrape_client/executions/get.rb', line 32

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

#pending?Boolean

Returns:

  • (Boolean)


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

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

#queued?Boolean

Returns:

  • (Boolean)


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

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

#running?Boolean

Returns:

  • (Boolean)


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

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

#stateObject



36
37
38
# File 'lib/cloudscrape_client/executions/get.rb', line 36

def state
  response.fetch(:state)
end

#stopped?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/cloudscrape_client/executions/get.rb', line 28

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