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

Instance Method Summary collapse

Instance Attribute Details

#active?true, false (readonly) Originally defined in module WithStatus

#closed?true, false (readonly) Originally defined in module WithStatus

#failed?true, false (readonly) Originally defined in module WithStatus

#maxFloat



34
35
36
# File 'lib/natty-ui/progress.rb', line 34

def max
  @max
end

#statusSymbol? (readonly) Originally defined in module WithStatus

#titleString



14
15
16
# File 'lib/natty-ui/progress.rb', line 14

def title
  @title
end

#valueFloat



23
24
25
# File 'lib/natty-ui/progress.rb', line 23

def value
  @value
end

Instance Method Details

#failed(*text) {|failed| ... } ⇒ Features Originally defined in module WithStatus

Close the element with a failure.

Yields:

  • optionally, when block is given

Yield Parameters:

#ok(*text) ⇒ Features Also known as: done Originally defined in module WithStatus

Close the element.

#ok?true, false Originally defined in module WithStatus

#step(count: 1, title: nil) ⇒ ProgressHelper

Increment #value and/or change #title.



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