Methods
Public Class methods
[ show source ]
# File lib/raw/dispatcher/format/xoxo.rb, line 9
9: def initialize
10: @name = "xoxo"
11: @content_type = "application/xoxo+xml"
12: @extension = "xoxo"
13: @template_extension = "xoxox"
14: end
Public Instance methods
[ show source ]
# File lib/raw/dispatcher/format/xoxo.rb, line 16
16: def after_action(controller, context)
17: if controller.out.blank?
18: if model = controller.class.ann(:self, :model)
19: resource = model.to_s.demodulize.underscore
20: if collection = controller.instance_variable_get("@#{resource.plural}")
21: controller.send(:print, XOXO.dump(collection))
22: elsif resource = controller.instance_variable_get("@#{resource}")
23: controller.send(:print, XOXO.dump(resource))
24: end
25: end
26: end
27: end