Sha256: 95ca0ee4f8ea182f45514766ec8a7f4632892a15cf892b28be58fc8342fbe1fd
Contents?: true
Size: 518 Bytes
Versions: 5
Compression:
Stored size: 518 Bytes
Contents
module Bunto module LiquidExtensions # Lookup a Liquid variable in the given context. # # context - the Liquid context in question. # variable - the variable name, as a string. # # Returns the value of the variable in the context # or the variable name if not found. def lookup_variable(context, variable) lookup = context variable.split(".").each do |value| lookup = lookup[value] end lookup || variable end end end
Version data entries
5 entries across 5 versions & 1 rubygems