Class: TxghQueue::Status
- Inherits:
-
Object
- Object
- TxghQueue::Status
- Defined in:
- lib/txgh-queue/status.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
- #fail? ⇒ Boolean
-
#initialize(options = {}) ⇒ Status
constructor
A new instance of Status.
- #ok? ⇒ Boolean
- #retry? ⇒ Boolean
- #retry_with_delay? ⇒ Boolean
- #retry_without_delay? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Status
Returns a new instance of Status.
23 24 25 |
# File 'lib/txgh-queue/status.rb', line 23 def initialize( = {}) @status = .fetch(:status) end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
21 22 23 |
# File 'lib/txgh-queue/status.rb', line 21 def status @status end |
Class Method Details
.fail ⇒ Object
12 13 14 |
# File 'lib/txgh-queue/status.rb', line 12 def fail @fail ||= new(status: :fail) end |
.ok ⇒ Object
16 17 18 |
# File 'lib/txgh-queue/status.rb', line 16 def ok @ok ||= new(status: :ok) end |
.retry_with_delay ⇒ Object
8 9 10 |
# File 'lib/txgh-queue/status.rb', line 8 def retry_with_delay @retry_with_delay ||= new(status: :retry_with_delay) end |
.retry_without_delay ⇒ Object
4 5 6 |
# File 'lib/txgh-queue/status.rb', line 4 def retry_without_delay @retry ||= new(status: :retry_without_delay) end |
Instance Method Details
#fail? ⇒ Boolean
39 40 41 |
# File 'lib/txgh-queue/status.rb', line 39 def fail? status == :fail end |
#ok? ⇒ Boolean
43 44 45 |
# File 'lib/txgh-queue/status.rb', line 43 def ok? status == :ok end |
#retry? ⇒ Boolean
27 28 29 |
# File 'lib/txgh-queue/status.rb', line 27 def retry? retry_with_delay? || retry_without_delay? end |
#retry_with_delay? ⇒ Boolean
31 32 33 |
# File 'lib/txgh-queue/status.rb', line 31 def retry_with_delay? status == :retry_with_delay end |
#retry_without_delay? ⇒ Boolean
35 36 37 |
# File 'lib/txgh-queue/status.rb', line 35 def retry_without_delay? status == :retry_without_delay end |
#to_s ⇒ Object
47 48 49 |
# File 'lib/txgh-queue/status.rb', line 47 def to_s status.to_s end |