Class: Ruql::Json

Inherits:
Object
  • Object
show all
Defined in:
lib/ruql/json.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(quiz, options = {}) ⇒ Json

Returns a new instance of Json.



4
5
6
7
# File 'lib/ruql/json.rb', line 4

def initialize(quiz, options={})
  @quiz = quiz
  @output = ''
end

Instance Attribute Details

#outputObject (readonly)

Returns the value of attribute output.



3
4
5
# File 'lib/ruql/json.rb', line 3

def output
  @output
end

Instance Method Details

#render_quizObject



8
9
10
# File 'lib/ruql/json.rb', line 8

def render_quiz
  @output = JSON.pretty_generate(@quiz.as_json)
end