class ProgressBar::Format::Molecule
def bar_molecule?
def bar_molecule? BAR_MOLECULES.include? key end
def full_key
def full_key "%#{key}" end
def initialize(letter)
def initialize(letter) self.key = letter self.method_name = MOLECULES.fetch(key.to_sym) end
def lookup_value(environment, length = 0)
def lookup_value(environment, length = 0) component = environment.__send__(method_name[0]) if bar_molecule? component.__send__(method_name[1], length).to_s else component.__send__(method_name[1]).to_s end end
def non_bar_molecule?
def non_bar_molecule? !bar_molecule? end