Class: ProgressBar::Format::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/progress_bar/format/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#moleculesObject (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_moleculesObject



14
15
16
# File 'lib/progress_bar/format/base.rb', line 14

def bar_molecules
  molecules.select { |molecule| molecule.bar_molecule? }
end

#non_bar_moleculesObject



10
11
12
# File 'lib/progress_bar/format/base.rb', line 10

def non_bar_molecules
  molecules.select { |molecule| !molecule.bar_molecule? }
end