class Rye::Tpl
Attributes
basename[R]
result[R]
src[R]
Public Class Methods
new(src, basename='rye-template')
click to toggle source
# File lib/rye.rb, line 287 def initialize(src, basename='rye-template') @basename = basename src = src.to_s @src, @template = src, ERB.new(src) end
Public Instance Methods
delete()
click to toggle source
# File lib/rye.rb, line 300 def delete File.delete(@tf.path) if File.exists?(@tf.path) end
path()
click to toggle source
# File lib/rye.rb, line 292 def path if @tf.nil? @tf = Tempfile.new basename @tf.write @result @tf.close end @tf.path end
result!(binding)
click to toggle source
# File lib/rye.rb, line 303 def result!(binding) @result = result(binding) end
to_s()
click to toggle source
# File lib/rye.rb, line 309 def to_s() src end