Class: CSKit::Readers::AnnotatedReading

Inherits:
Reading
  • Object
show all
Defined in:
lib/cskit/readers/reading.rb

Instance Attribute Summary

Attributes inherited from Reading

#chapter, #citation, #texts, #verse

Instance Method Summary collapse

Methods inherited from Reading

#params, #to_annotated_reading, #to_hash

Instance Method Details

#add_annotation(text_index, annotation) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/cskit/readers/reading.rb', line 28

def add_annotation(text_index, annotation)
  if idx = index(text_index, annotation)
    annotations[text_index].delete_at(idx)
  end

  (annotations[text_index] ||= []) << annotation
end

#annotated?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/cskit/readers/reading.rb', line 44

def annotated?
  true
end

#annotationsObject



40
41
42
# File 'lib/cskit/readers/reading.rb', line 40

def annotations
  @annotations ||= {}
end

#annotations_at(index) ⇒ Object



36
37
38
# File 'lib/cskit/readers/reading.rb', line 36

def annotations_at(index)
  annotations[index]
end