Sha256: 325ef11059120403dd20f52643484c8d79eba8882d74ddadd9453307924ccfaa

Contents?: true

Size: 316 Bytes

Versions: 3

Compression:

Stored size: 316 Bytes

Contents

require 'rabl'

module Gon
  module Rabl
    class << self
      def parse_rabl(rabl_path, controller)
        source = File.read(rabl_path)
        rabl_engine = ::Rabl::Engine.new(source, :format => 'json')
        output = rabl_engine.render(controller, {})
        JSON.parse(output)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gon-2.0.6 lib/gon/rabl.rb
gon-2.0.5 lib/gon/rabl.rb
gon-2.0.4 lib/gon/rabl.rb