File: handler.rb

package info (click to toggle)
ruby-rabl-rails 0.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 268 kB
  • ctags: 179
  • sloc: ruby: 1,480; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 387 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'active_support/core_ext/class/attribute'

module RablRails
  module Handlers
    class Rabl
      class_attribute :default_format
      self.default_format = 'application/json'

      def self.call(template)
        %{
          RablRails::Library.instance.
            get_rendered_template(#{template.source.inspect}, self, local_assigns)
        }
      end
    end
  end
end