Class: Axiom::Aggregate::Maximum
- Inherits:
-
Axiom::Aggregate
- Object
- Function
- Axiom::Aggregate
- Axiom::Aggregate::Maximum
- Defined in:
- lib/axiom/aggregate/maximum.rb
Overview
The maximum value in a sequence of numbers
Defined Under Namespace
Modules: Methods
Constant Summary collapse
- DEFAULT =
-Float::INFINITY
Instance Attribute Summary
Attributes included from Operation::Unary
Class Method Summary collapse
-
.call(maximum, value) ⇒ Numeric
Return the maximum value for a sequence of numbers.
Instance Method Summary collapse
-
#type ⇒ Class<Types::Numeric>
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
Methods included from Visitable
Class Method Details
.call(maximum, value) ⇒ Numeric
Return the maximum value for a sequence of numbers
23 24 25 26 |
# File 'lib/axiom/aggregate/maximum.rb', line 23 def self.call(maximum, value) return maximum if value.nil? value > maximum ? value : maximum end |
Instance Method Details
#type ⇒ Class<Types::Numeric>
Return the type returned from #call
36 37 38 |
# File 'lib/axiom/aggregate/maximum.rb', line 36 def type Attribute.infer_type(operand) end |