Class: Spree::Reporting::Adapters::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/spree/reporting/adapters/base.rb

Overview

Storage adapter contract. Adapters receive a normalized Spree::Reporting::Query and return a Spree::Reporting::Result with raw numeric values — the query never changes shape across adapters, which is what lets storage move from live OLTP to fact tables (or an external OLAP store) without touching consumers.

Post-aggregation metric semantics (value casting, derived ratios, the nil-baseline growth convention) live here so every adapter reports identical numbers — the drift between hand-rolled growth implementations is what this layer replaces.

Direct Known Subclasses

Live

Instance Method Summary collapse

Instance Method Details

#execute(query) ⇒ Object

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/spree/reporting/adapters/base.rb', line 15

def execute(query)
  raise NotImplementedError, "#{self.class.name} must implement #execute"
end