Sha256: 1badaf37b3cbe0bee8cc02e827f590f397e654ae2c4d4df13f59cab302a5792c
Contents?: true
Size: 666 Bytes
Versions: 3
Compression:
Stored size: 666 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 def random(input) rand(input.to_i) end end ::Liquid::Template.register_filter(Misc) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems