Class: AtomicAssessmentsImport::ExamSoft::Chunker::Strategy

Inherits:
Object
  • Object
show all
Defined in:
lib/atomic_assessments_import/exam_soft/chunker/strategy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStrategy

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_nodesObject (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.

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/atomic_assessments_import/exam_soft/chunker/strategy.rb', line 16

def split(doc)
  raise NotImplementedError
end