Module: Prezzo::Explainable::ClassMethods

Defined in:
lib/prezzo/explainable.rb

Instance Method Summary collapse

Instance Method Details

#explain_with(*options) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/prezzo/explainable.rb', line 10

def explain_with(*options)
  define_method(:explain) do
    explanation = {}

    options.each do |method|
      explanation[method] = send(method)
    end

    explanation
  end
end