Module: Lite::Containers::Helpers::Comparison

Defined in:
lib/lite/containers/helpers/comparison.rb

Defined Under Namespace

Classes: Abstract, Error, Max, Min

Class Method Summary collapse

Class Method Details

.instance(type, key_extractor: nil) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/lite/containers/helpers/comparison.rb', line 11

def self.instance(type, key_extractor: nil)
  type = type.to_sym
  case type
  when :max then Max.instance(key_extractor)
  when :min then Min.instance(key_extractor)
  else raise Error, "Unexpected comparison type: '#{type}'"
  end
end