Class: ProgressBar::Format::Base
- Inherits:
-
Object
- Object
- ProgressBar::Format::Base
- Defined in:
- lib/progress_bar/format/base.rb
Instance Attribute Summary collapse
-
#molecules ⇒ Object
readonly
Returns the value of attribute molecules.
Instance Method Summary collapse
- #bar_molecules ⇒ Object
-
#initialize(format_string) ⇒ Base
constructor
A new instance of Base.
- #non_bar_molecules ⇒ Object
Constructor Details
#initialize(format_string) ⇒ Base
Returns a new instance of Base.
6 7 8 |
# File 'lib/progress_bar/format/base.rb', line 6 def initialize(format_string) @molecules = parse(format_string) end |
Instance Attribute Details
#molecules ⇒ Object (readonly)
Returns the value of attribute molecules.
4 5 6 |
# File 'lib/progress_bar/format/base.rb', line 4 def molecules @molecules end |
Instance Method Details
#bar_molecules ⇒ Object
14 15 16 |
# File 'lib/progress_bar/format/base.rb', line 14 def molecules.select { |molecule| molecule. } end |
#non_bar_molecules ⇒ Object
10 11 12 |
# File 'lib/progress_bar/format/base.rb', line 10 def molecules.select { |molecule| !molecule. } end |