Class: Axiom::Aggregate::Count
- Inherits:
-
Axiom::Aggregate
- Object
- Function
- Axiom::Aggregate
- Axiom::Aggregate::Count
- Defined in:
- lib/axiom/aggregate/count.rb
Overview
The count of a series of values
Defined Under Namespace
Modules: Methods
Constant Summary collapse
- DEFAULT =
0
Instance Attribute Summary
Attributes included from Operation::Unary
Class Method Summary collapse
-
.call(count, value) ⇒ Integer
Return the count for a series of values.
-
.type ⇒ Class<Types::Integer>
Return the type returned from #call.
Methods inherited from Axiom::Aggregate
#call, #default, default, finalize, #finalize
Methods included from Operation::Unary
Methods inherited from Function
extract_value, rename_attributes, #type
Methods included from Visitable
Class Method Details
.call(count, value) ⇒ Integer
Return the count for a series of values
23 24 25 |
# File 'lib/axiom/aggregate/count.rb', line 23 def self.call(count, value) value.nil? ? count : count.succ end |
.type ⇒ Class<Types::Integer>
Return the type returned from #call
35 36 37 |
# File 'lib/axiom/aggregate/count.rb', line 35 def self.type Types::Integer end |