Module: Pomodoro::Formats::Review::Plugins::Consumption

Defined in:
lib/pomodoro/formats/review/plugins/consumption.rb

Overview

TODO: Add totals: 1.9 Tequila 35% 1.5 shots. 2.3 Glass of wine. Total: 4.2

Don't parse it, it'd be updated from the data.

Defined Under Namespace

Classes: ConsumptionItem, ConsumptionItems, Parser, Transformer

Class Method Summary collapse

Class Method Details

.parse(string) ⇒ Object


20
21
22
23
24
# File 'lib/pomodoro/formats/review/plugins/consumption.rb', line 20

def self.parse(string)
  tree = Parser.new.parse(string)
  nodes = Transformer.new.apply(tree)
  ConsumptionItems.new(nodes.empty? ? Array.new : nodes)
end