Sha256: d69d4c167ec9b384e8ce01e48c9c29738d99e7cb647f799b418ae9b8c2d78741
Contents?: true
Size: 530 Bytes
Versions: 83
Compression:
Stored size: 530 Bytes
Contents
# frozen_string_literal: true module Bridgetown 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
83 entries across 83 versions & 1 rubygems