Class: DirtyPipeline::Status
- Inherits:
-
Object
- Object
- DirtyPipeline::Status
- Defined in:
- lib/dirty_pipeline/status.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#success ⇒ Object
readonly
Returns the value of attribute success.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Class Method Summary collapse
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(success, data, tag = nil) ⇒ Status
constructor
A new instance of Status.
- #success? ⇒ Boolean
Constructor Details
#initialize(success, data, tag = nil) ⇒ Status
Returns a new instance of Status.
13 14 15 16 17 |
# File 'lib/dirty_pipeline/status.rb', line 13 def initialize(success, data, tag = nil) @success = success @data = data @tag = tag end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/dirty_pipeline/status.rb', line 3 def data @data end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
3 4 5 |
# File 'lib/dirty_pipeline/status.rb', line 3 def success @success end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
3 4 5 |
# File 'lib/dirty_pipeline/status.rb', line 3 def tag @tag end |
Class Method Details
.failure(data, tag: :exception) ⇒ Object
9 10 11 |
# File 'lib/dirty_pipeline/status.rb', line 9 def self.failure(data, tag: :exception) new(false, data, tag) end |
.success(data, tag: :success) ⇒ Object
5 6 7 |
# File 'lib/dirty_pipeline/status.rb', line 5 def self.success(data, tag: :success) new(true, data, tag) end |
Instance Method Details
#failure? ⇒ Boolean
23 24 25 |
# File 'lib/dirty_pipeline/status.rb', line 23 def failure? !success? end |
#success? ⇒ Boolean
19 20 21 |
# File 'lib/dirty_pipeline/status.rb', line 19 def success? !!success end |