Module: Interrogative::ClassMethods

Includes:
BaseMethods
Defined in:
lib/interrogative.rb

Overview

Methods tailored to the class level.

These handle inheritance of questions.

Instance Method Summary collapse

Methods included from BaseMethods

#postprocess_question, #question, #when_questioned

Instance Method Details

#questionsArray<Question>

Get the array of all noted questions for this class and its superclasses.

Returns:

  • (Array<Question>)

    array of all noted questions.



62
63
64
65
66
67
# File 'lib/interrogative.rb', line 62

def questions
  qs = []
  qs |= superclass.questions if superclass.respond_to? :questions
  qs |= (@_questions||=[])
  qs
end