Sha256: 1f36bd9ecb487169515cf9b94a48f497653686cc1431e97c3d31e0b0c257a171
Contents?: true
Size: 589 Bytes
Versions: 31
Compression:
Stored size: 589 Bytes
Contents
module Troy class XML # The XML content. # attr_reader :content # The data that must be rendered within # the Troy::Context object. # attr_reader :data def initialize(content, data) @content = content @data = data end def context @context ||= Context.new(data.merge(:xml => xml)).extend(Helpers) end def xml @xml ||= Builder::XmlMarkup.new(:indent => 2) end def to_xml @to_xml ||= begin xml.instruct! context.instance_eval(content) xml.target! end end end end
Version data entries
31 entries across 31 versions & 1 rubygems