Sha256: 2865e2c435c02bf203ab9aa2bc354a39adbbee11e822371c81e47336933a63b9

Contents?: true

Size: 339 Bytes

Versions: 6

Compression:

Stored size: 339 Bytes

Contents

# frozen_string_literal: true

module MinFilter
  # Returns the min of the items in the array
  #
  # input - the object array
  #
  # Returns the min
  def min(input)
    return input unless input.respond_to?(:min)

    input = input.values if input.is_a?(Hash) # FIXME
    input.min
  end
end
Liquid::Template.register_filter(MinFilter)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
liquidum-1.2.1 lib/liquidum/liquid/filters/min_filter.rb
liquidum-1.2.0 lib/liquidum/liquid/filters/min_filter.rb
liquidum-1.1.2 lib/liquidum/liquid/filters/min_filter.rb
liquidum-1.1.1 lib/liquidum/liquid/filters/min_filter.rb
liquidum-1.1.0 lib/liquidum/liquid/filters/min_filter.rb
liquidum-1.0.22 lib/liquidum/liquid/filters/min_filter.rb