Class: Seam::ActionAttempt
- Inherits:
-
BaseResource
- Object
- BaseResource
- Seam::ActionAttempt
- Defined in:
- lib/seam/resources/action_attempt.rb
Constant Summary collapse
- SLEEP_TIME =
0.2
- MAX_ATTEMPTS =
10
Instance Attribute Summary collapse
-
#action_attempt_id ⇒ Object
Returns the value of attribute action_attempt_id.
-
#action_type ⇒ Object
Returns the value of attribute action_type.
-
#result ⇒ Object
Returns the value of attribute result.
-
#status ⇒ Object
Returns the value of attribute status.
Attributes inherited from BaseResource
Instance Method Summary collapse
Methods inherited from BaseResource
date_accessor, #initialize, #inspect, load_from_response, #update_from_response
Constructor Details
This class inherits a constructor from Seam::BaseResource
Instance Attribute Details
#action_attempt_id ⇒ Object
Returns the value of attribute action_attempt_id.
5 6 7 |
# File 'lib/seam/resources/action_attempt.rb', line 5 def action_attempt_id @action_attempt_id end |
#action_type ⇒ Object
Returns the value of attribute action_type.
5 6 7 |
# File 'lib/seam/resources/action_attempt.rb', line 5 def action_type @action_type end |
#result ⇒ Object
Returns the value of attribute result.
5 6 7 |
# File 'lib/seam/resources/action_attempt.rb', line 5 def result @result end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'lib/seam/resources/action_attempt.rb', line 5 def status @status end |
Instance Method Details
#update! ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/seam/resources/action_attempt.rb', line 20 def update! response = @client.request_seam( :post, "/action_attempts/get", body: { action_attempt_id: action_attempt_id } ) update_from_response(response["action_attempt"]) end |
#wait_until_finished ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/seam/resources/action_attempt.rb', line 10 def wait_until_finished while @status == "pending" update! sleep(SLEEP_TIME) end self end |