Class: Conveyor::Status
- Inherits:
-
Object
- Object
- Conveyor::Status
- Defined in:
- lib/conveyor/status.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#success ⇒ Object
readonly
Returns the value of attribute success.
Instance Method Summary collapse
- #fail!(v = false) ⇒ Object
-
#initialize(path = nil) ⇒ Status
constructor
A new instance of Status.
- #reset!(path = nil) ⇒ Object
- #success!(v = true) ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(path = nil) ⇒ Status
Returns a new instance of Status.
7 8 9 |
# File 'lib/conveyor/status.rb', line 7 def initialize(path = nil) reset!(path) end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
4 5 6 |
# File 'lib/conveyor/status.rb', line 4 def errors @errors end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/conveyor/status.rb', line 5 def path @path end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
3 4 5 |
# File 'lib/conveyor/status.rb', line 3 def success @success end |
Instance Method Details
#fail!(v = false) ⇒ Object
17 18 19 |
# File 'lib/conveyor/status.rb', line 17 def fail!(v = false) @success &= v end |
#reset!(path = nil) ⇒ Object
11 12 13 14 15 |
# File 'lib/conveyor/status.rb', line 11 def reset!(path = nil) @path = path @success = true @errors = [] end |
#success!(v = true) ⇒ Object
21 22 23 |
# File 'lib/conveyor/status.rb', line 21 def success!(v=true) @success &= v end |
#success? ⇒ Boolean
25 26 27 |
# File 'lib/conveyor/status.rb', line 25 def success? @success end |