Sha256: a95cded1595bb4dc1ffb494b93ffcf821b5cae2cf0dc2a3e9af3eefa0711f3b0
Contents?: true
Size: 816 Bytes
Versions: 13
Compression:
Stored size: 816 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, context = {}) send(:"generate_#{code.type}", code) rescue NoMethodError => e if e.name == :"_generate_code_#{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
13 entries across 13 versions & 1 rubygems