# File lib/ec2/query_parser.rb, line 89 def initialize(query, object, context) @context = context @query = query @object = object end
# File lib/ec2/query_parser.rb, line 81 def self.parse(query, result, context) parser = new(query, result, context) layout = "%#{query.action.to_s.camelize}Response{:xmlns => 'http://ec2.amazonaws.com/doc/2012-04-01/'}\n"+ "\t%requestId #{query.request_id}\n" + "\t=render(:#{query.action}, object)\n" Haml::Engine.new(layout, :filename => 'layout').render(parser) end
# File lib/ec2/query_parser.rb, line 95 def build_xml Converter.convert(query.action, object) end
# File lib/ec2/query_parser.rb, line 99 def render(template, obj) template_filename = File.join(File.dirname(__FILE__), 'views', '%s.haml' % template.to_s) Haml::Engine.new(File.read(template_filename), :filename => template_filename).render(self, :object => obj) end