Class: Threads::API::ThreadStatus

Inherits:
UnpublishedThread show all
Defined in:
lib/threads/api/thread.rb

Instance Attribute Summary collapse

Attributes inherited from UnpublishedThread

#id

Instance Method Summary collapse

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_messageObject (readonly)

Returns the value of attribute error_message.



52
53
54
# File 'lib/threads/api/thread.rb', line 52

def error_message
  @error_message
end

#statusObject (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

Returns:

  • (Boolean)


73
74
75
# File 'lib/threads/api/thread.rb', line 73

def errored?
  @status == "ERROR"
end

#expired?Boolean

Returns:

  • (Boolean)


77
78
79
# File 'lib/threads/api/thread.rb', line 77

def expired?
  @status == "EXPIRED"
end

#finished?Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/threads/api/thread.rb', line 65

def finished?
  @status == "FINISHED"
end

#in_progress?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/threads/api/thread.rb', line 61

def in_progress?
  @status == "IN_PROGRESS"
end

#published?Boolean

Returns:

  • (Boolean)


69
70
71
# File 'lib/threads/api/thread.rb', line 69

def published?
  @status == "PUBLISHED"
end