class Question

Define Question class

Attributes

bads[RW]
comment[RW]
feedback[RW]
good[RW]
lang[RW]
matching[RW]
name[RW]
shorts[RW]
tags[RW]
text[RW]
type[R]

Public Class Methods

new(type = :choice) click to toggle source
# File lib/asker/ai/question.rb, line 12
def initialize(type = :choice)
  reset(type)
end

Public Instance Methods

reset(type = :choice) click to toggle source
# File lib/asker/ai/question.rb, line 16
def reset(type = :choice)
  @name = ''
  @comment = ''
  @text = ''
  @type = type
  @good = ''
  @bads = []
  @matching = []
  @shorts = []
  @feedback = nil
  shuffle_on
  @tags = Set.new
  @lang = nil
end
set_boolean() click to toggle source
# File lib/asker/ai/question.rb, line 39
def set_boolean
  @type = :boolean
end
set_choice() click to toggle source
# File lib/asker/ai/question.rb, line 31
def set_choice
  @type = :choice
end
set_match() click to toggle source
# File lib/asker/ai/question.rb, line 35
def set_match
  @type = :match
end
set_short() click to toggle source
# File lib/asker/ai/question.rb, line 43
def set_short
  @type = :short
end
shuffle?() click to toggle source
# File lib/asker/ai/question.rb, line 55
def shuffle?
  @shuffle
end
shuffle_off() click to toggle source
# File lib/asker/ai/question.rb, line 47
def shuffle_off
  @shuffle = false
end
shuffle_on() click to toggle source
# File lib/asker/ai/question.rb, line 51
def shuffle_on
  @shuffle = true
end