Sha256: 97e94a4b725c7d12ac2641419e6c5538017fdfd842b111c169cfde52d89296b4
Contents?: true
Size: 796 Bytes
Versions: 32
Compression:
Stored size: 796 Bytes
Contents
module Liquidscript module Generator class Base module Replacements # Replace a code with a string. This uses the replacement # definitions that are a part of the class. # # @param code [ICR::Code, #type] # @param context [Hash] def replace(code) send(:"generate_#{code.type}", code) rescue NoMethodError => e if e.name == :"generate_#{code.type}" raise InvalidCodeError.new(code.type) else raise end end # Access to the replacements method on the class. # # @see [ClassMethods#replacements] # @return [Hash] def replacements self.class.replacements end end end end end
Version data entries
32 entries across 32 versions & 1 rubygems