Method: XX::Template::Basic#expand

Defined in:
lib/xx.rb,
lib/xx-2.1.0.rb

#expand(binding, opts = {}) ⇒ Object Also known as: result

–}}}



695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
# File 'lib/xx.rb', line 695

def expand binding, opts = {}
#--{{{
  port = opts['port'] || opts[:port] || STDOUT
  pretty = opts['pretty'] || opts[:pretty]

  object = eval 'self', binding

  unless type === object 
    __m = type
    klass = object.class
    klass.module_eval{ include __m } 
  end

  doc = eval @template, binding 

  display = pretty ? 'pretty' : 'to_str'

  doc.send display, port
#--}}}
end