Sha256: 2e2d12dc083f5781570feeb7f2551c5c4a45bd7cdd7138f40e8809fd632de2ae
Contents?: true
Size: 653 Bytes
Versions: 108
Compression:
Stored size: 653 Bytes
Contents
# encoding: utf-8 require 'erb' class EndERB class << self # for single template script using __END__ and DATA # # === Params # # * <tt>:hash</tt> - erb template variable hash # # === Example # # def hoge # hash = { # hoge: '@hoge@', # hige: '@hige@', # } # EndERB.apply(hash) # end # # puts hoge # # __END__ # hoge=<%=hoge%> # hige=<%=hige%> # # output # # hoge=@hoge@ # hige=@hige@ # def apply(hash) ERB.new(DATA.read).result(binding) end end end
Version data entries
108 entries across 108 versions & 1 rubygems