Method: Graphiti::Stats::DSL#calculation
- Defined in:
- lib/graphiti/stats/dsl.rb
#calculation(name) ⇒ Proc
Grab a calculation proc. Raises error if no corresponding stat has been configured.
64 65 66 67 |
# File 'lib/graphiti/stats/dsl.rb', line 64 def calculation(name) callable = @calculations[name] || @calculations[name.to_sym] callable || raise(Errors::StatNotFound.new(@name, name)) end |