Sha256: dca22d05edeaf2e649f97eb4d0dfe518562cc0afa18425f78e9f4b258bcd5e9b

Contents?: true

Size: 294 Bytes

Versions: 7

Compression:

Stored size: 294 Bytes

Contents

# frozen_string_literal: true

module FormatFilter
  # Applies format to input
  #
  # Example:
  #   <div class="summary">{{title | format: '%20s'}}</div>
  ##
  def format(input, format_string)
    Kernel.format(format_string, input)
  end
end

Liquid::Template.register_filter(FormatFilter)

Version data entries

7 entries across 7 versions & 1 rubygems

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