Module: NattyUI::ProgressHelper
- Includes:
- WithStatus
- Defined in:
- lib/natty-ui/progress.rb
Overview
TODO:
This chapter needs more documentation.
Progress indictaor helper used by Features#progress.
Instance Attribute Summary collapse
-
#active? ⇒ true, false
included
from WithStatus
readonly
Whether the element is still active.
-
#closed? ⇒ true, false
included
from WithStatus
readonly
Whether the element is completed.
-
#failed? ⇒ true, false
included
from WithStatus
readonly
Whether the element is completed with failure.
- #max ⇒ Float
-
#status ⇒ Symbol?
included
from WithStatus
readonly
Element's current status.
- #title ⇒ String
- #value ⇒ Float
Instance Method Summary collapse
-
#failed(*text) {|failed| ... } ⇒ Element
included
from WithStatus
Close the element with a failure.
-
#ok(*text) ⇒ Element
(also: #done)
included
from WithStatus
Close the element.
-
#ok? ⇒ true, false
included
from WithStatus
Whether the element is completed.
- #step(count: 1, title: nil) ⇒ ProgressHelper
Instance Attribute Details
#active? ⇒ true, false (readonly) Originally defined in module WithStatus
Returns whether the element is still active.
#closed? ⇒ true, false (readonly) Originally defined in module WithStatus
Returns whether the element is completed.
#failed? ⇒ true, false (readonly) Originally defined in module WithStatus
Returns whether the element is completed with failure.
#max ⇒ Float
34 35 36 |
# File 'lib/natty-ui/progress.rb', line 34 def max @max end |
#status ⇒ Symbol? (readonly) Originally defined in module WithStatus
Returns element's current status.
#title ⇒ String
14 15 16 |
# File 'lib/natty-ui/progress.rb', line 14 def title @title end |
#value ⇒ Float
23 24 25 |
# File 'lib/natty-ui/progress.rb', line 23 def value @value end |
Instance Method Details
#failed(*text) {|failed| ... } ⇒ Element Originally defined in module WithStatus
Close the element with a failure.
#ok(*text) ⇒ Element Also known as: done Originally defined in module WithStatus
Close the element.
#ok? ⇒ true, false Originally defined in module WithStatus
Returns whether the element is completed.
#step(count: 1, title: nil) ⇒ ProgressHelper
52 53 54 55 56 |
# File 'lib/natty-ui/progress.rb', line 52 def step(count: 1, title: nil) @title = title if title self.value += count self end |