class Troy::XML
def context
def context @context ||= Context.new(data.merge(xml: xml)).extend(Helpers) end
def initialize(content, data)
def initialize(content, data) @content = content @data = data end
def to_xml
def to_xml @to_xml ||= begin xml.instruct! context.instance_eval(content) xml.target! end end
def xml
def xml @xml ||= Builder::XmlMarkup.new(indent: 2) end