Sha256: 99e79844784dcec34326b304660b1e3e57b1395c4d14fc03f773b97a7f961dae
Contents?: true
Size: 594 Bytes
Versions: 4
Compression:
Stored size: 594 Bytes
Contents
module Locomotive module Wagon module Liquid module Filters module Misc # was called modulo at first def str_modulo(word, index, modulo) (index.to_i + 1) % modulo == 0 ? word : '' end # Get the nth element of the passed in array def index(array, position) array.at(position) if array.respond_to?(:at) end def default(input, value) input.blank? ? value : input end end ::Liquid::Template.register_filter(Misc) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems