Sha256: 354dc497162c4a53f5cc7b1a83cec938669a9e00cc4b101d77c001b7917e521e

Contents?: true

Size: 284 Bytes

Versions: 4

Compression:

Stored size: 284 Bytes

Contents

require 'rabl'

module Gon::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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gon-2.0.3 lib/gon/rabl.rb
gon-2.0.2 lib/gon/rabl.rb
gon-2.0.1 lib/gon/rabl.rb
gon-2.0.0 lib/gon/rabl.rb