Sha256: dec2dc762ca3d038ff498be974e8af61a39c694101be785039b9ee8243628a6d

Contents?: true

Size: 388 Bytes

Versions: 1

Compression:

Stored size: 388 Bytes

Contents

require 'rabl'

module Gon
  module Sinatra
    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, {})
          ::Rabl.configuration.json_engine.decode(output)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gon-sinatra-0.1.0 lib/gon/sinatra/rabl.rb