Sha256: 70997d9dc7e54894b7ba07731e9d3371527b8ae21714cca69534ac932656bc45

Contents?: true

Size: 339 Bytes

Versions: 6

Compression:

Stored size: 339 Bytes

Contents

# frozen_string_literal: true

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

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