Class: ZweaBot::Models::Element

Inherits:
ApplicationRecord show all
Defined in:
lib/zwea_bot/models/element.rb

Instance Method Summary collapse

Instance Method Details

#report_linesObject



15
16
17
# File 'lib/zwea_bot/models/element.rb', line 15

def report_lines
  ["- #{name} (#{identifier}): Qty #{total_quantity}"]
end

#total_quantityObject



11
12
13
# File 'lib/zwea_bot/models/element.rb', line 11

def total_quantity
  line_items.sum(&:quantity)
end