Sha256: 4ab480046522824cff3e63430933d0666f5ddc7df0aabcb0920b369f14441672

Contents?: true

Size: 452 Bytes

Versions: 1

Compression:

Stored size: 452 Bytes

Contents

module Prezzo
  module Explainable
    def explain
      explanation = {
        total: calculate,
      }

      components = compile_components
      explanation[:components] = components unless components.empty?

      context = compile_params
      explanation[:context] = context unless context.empty?

      transients = compile_transients
      explanation[:transients] = transients unless transients.empty?

      explanation
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
prezzo-1.0.0.pre.rc lib/prezzo/explainable.rb