Class: Streamer::Functors::Least
- Defined in:
- lib/streamer/functors/least.rb
Overview
least determines the least item in a list
Instance Attribute Summary
Attributes inherited from Functor
Instance Method Summary collapse
Methods inherited from Functor
Constructor Details
This class inherits a constructor from Streamer::Functors::Functor
Instance Method Details
#call ⇒ Object
5 6 7 |
# File 'lib/streamer/functors/least.rb', line 5 def call least end |
#least ⇒ Object
9 10 11 12 13 14 |
# File 'lib/streamer/functors/least.rb', line 9 def least vals = value(.fetch(:list).split('.')).map do |item| item[.fetch(:property)] end vals.sort.shift end |