Module: NattyUI::ProgressHelper
- 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
Instance Method Summary collapse
- #active? ⇒ Boolean
- #done(title = nil) ⇒ Object (also: #ok)
- #failed(title = nil) ⇒ Object
- #failed? ⇒ Boolean
- #ok? ⇒ Boolean
- #step(count: 1, title: nil) ⇒ Object
Instance Attribute Details
#max ⇒ Float
30 31 32 |
# File 'lib/natty-ui/progress.rb', line 30 def max @max end |
#title ⇒ String
10 11 12 |
# File 'lib/natty-ui/progress.rb', line 10 def title @title end |
#value ⇒ Float
19 20 21 |
# File 'lib/natty-ui/progress.rb', line 19 def value @value end |
Instance Method Details
#active? ⇒ Boolean
43 |
# File 'lib/natty-ui/progress.rb', line 43 def active? = @status.nil? |
#done(title = nil) ⇒ Object Also known as: ok
53 |
# File 'lib/natty-ui/progress.rb', line 53 def done(title = nil) = finish(:ok, title) |
#failed(title = nil) ⇒ Object
56 |
# File 'lib/natty-ui/progress.rb', line 56 def failed(title = nil) = finish(:failed, title) |
#failed? ⇒ Boolean
45 |
# File 'lib/natty-ui/progress.rb', line 45 def failed? = @status == :failed |
#ok? ⇒ Boolean
44 |
# File 'lib/natty-ui/progress.rb', line 44 def ok? = @status == :ok |
#step(count: 1, title: nil) ⇒ Object
47 48 49 50 51 |
# File 'lib/natty-ui/progress.rb', line 47 def step(count: 1, title: nil) @title = title if title self.value += count self end |