lib/streamer/functors/least.rb in streamer-0.1.1 vs lib/streamer/functors/least.rb in streamer-0.2.0
- old
+ new
@@ -1,14 +1,10 @@
module Streamer
module Functors
# least determines the least item in a list
class Least < Functor
def call
- least
- end
-
- def least
- vals = value(options.fetch(:list).split('.')).map do |item|
+ vals = list.map do |item|
item[options.fetch(:property)]
end
vals.sort.shift
end
end