Class: AtomicAssessmentsImport::ExamSoft::Chunker::Strategy
- Inherits:
-
Object
- Object
- AtomicAssessmentsImport::ExamSoft::Chunker::Strategy
- Defined in:
- lib/atomic_assessments_import/exam_soft/chunker/strategy.rb
Direct Known Subclasses
HeadingSplitStrategy, HorizontalRuleSplitStrategy, MetadataMarkerStrategy, NumberedQuestionStrategy
Instance Attribute Summary collapse
-
#header_nodes ⇒ Object
readonly
Returns the value of attribute header_nodes.
Instance Method Summary collapse
-
#initialize ⇒ Strategy
constructor
A new instance of Strategy.
-
#split(doc) ⇒ Object
Subclasses implement this.
Constructor Details
#initialize ⇒ Strategy
Returns a new instance of Strategy.
9 10 11 |
# File 'lib/atomic_assessments_import/exam_soft/chunker/strategy.rb', line 9 def initialize @header_nodes = [] end |
Instance Attribute Details
#header_nodes ⇒ Object (readonly)
Returns the value of attribute header_nodes.
7 8 9 |
# File 'lib/atomic_assessments_import/exam_soft/chunker/strategy.rb', line 7 def header_nodes @header_nodes end |
Instance Method Details
#split(doc) ⇒ Object
Subclasses implement this. Returns an array of chunks, where each chunk is an array of Nokogiri nodes belonging to one question. Returns empty array if this strategy doesn't apply to the document.
16 17 18 |
# File 'lib/atomic_assessments_import/exam_soft/chunker/strategy.rb', line 16 def split(doc) raise NotImplementedError end |