class JSONRenderer

Attributes

output[R]

Public Class Methods

new(quiz,options={}) click to toggle source
# File lib/ruql/renderers/json_renderer.rb, line 6
def initialize(quiz,options={})
  @output = ''
  @json_array = []
  @quiz = quiz
end

Public Instance Methods

render_quiz() click to toggle source
# File lib/ruql/renderers/json_renderer.rb, line 12
def render_quiz
  @output = @quiz.questions.map {|question| JSON.pretty_generate(question.to_JSON)}
end