Sha256: 21ce6e2e8afa566ef9974cf31f283147d6443a253b4c977732f31502c3743a4f
Contents?: true
Size: 364 Bytes
Versions: 15
Compression:
Stored size: 364 Bytes
Contents
require_relative '../function' Dentaku::AST::Function.register(:sum, :numeric, ->(*args) { if args.empty? raise Dentaku::ArgumentError.for( :too_few_arguments, function_name: 'SUM()', at_least: 1, given: 0 ), 'SUM() requires at least one argument' end args.flatten.map { |arg| Dentaku::AST::Function.numeric(arg) }.reduce(0, :+) })
Version data entries
15 entries across 15 versions & 2 rubygems