Class: Threads::API::ThreadStatus
- Inherits:
-
UnpublishedThread
- Object
- UnpublishedThread
- Threads::API::ThreadStatus
- Defined in:
- lib/threads/api/thread.rb
Instance Attribute Summary collapse
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Attributes inherited from UnpublishedThread
Instance Method Summary collapse
- #errored? ⇒ Boolean
- #expired? ⇒ Boolean
- #finished? ⇒ Boolean
- #in_progress? ⇒ Boolean
-
#initialize(json) ⇒ ThreadStatus
constructor
A new instance of ThreadStatus.
- #published? ⇒ Boolean
Constructor Details
#initialize(json) ⇒ ThreadStatus
Returns a new instance of ThreadStatus.
54 55 56 57 58 59 |
# File 'lib/threads/api/thread.rb', line 54 def initialize(json) super @status = json["status"] @error_message = json["error_message"] end |
Instance Attribute Details
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
52 53 54 |
# File 'lib/threads/api/thread.rb', line 52 def @error_message end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
52 53 54 |
# File 'lib/threads/api/thread.rb', line 52 def status @status end |
Instance Method Details
#errored? ⇒ Boolean
73 74 75 |
# File 'lib/threads/api/thread.rb', line 73 def errored? @status == "ERROR" end |
#expired? ⇒ Boolean
77 78 79 |
# File 'lib/threads/api/thread.rb', line 77 def expired? @status == "EXPIRED" end |
#finished? ⇒ Boolean
65 66 67 |
# File 'lib/threads/api/thread.rb', line 65 def finished? @status == "FINISHED" end |
#in_progress? ⇒ Boolean
61 62 63 |
# File 'lib/threads/api/thread.rb', line 61 def in_progress? @status == "IN_PROGRESS" end |
#published? ⇒ Boolean
69 70 71 |
# File 'lib/threads/api/thread.rb', line 69 def published? @status == "PUBLISHED" end |