class PnoteClient::Documents::Pnote

Attributes

chapters[R]
images[R]

Public Class Methods

new() click to toggle source
# File lib/pnote_client/documents/pnote.rb, line 6
def initialize()
  @chapters = []
  @images = []
end

Public Instance Methods

add_chapter(new_chapter) click to toggle source
# File lib/pnote_client/documents/pnote.rb, line 11
def add_chapter(new_chapter)
  @chapters << new_chapter
end
add_image(new_image) click to toggle source
# File lib/pnote_client/documents/pnote.rb, line 15
def add_image(new_image)
  @images << new_image
end
exercise_count() click to toggle source
# File lib/pnote_client/documents/pnote.rb, line 19
def exercise_count
  return @chapters.sum do |chapter|
    chapter.sub_chapters.sum do |sub_chapter|
      sub_chapter.exercises.count
    end
  end
end
practice_count() click to toggle source
# File lib/pnote_client/documents/pnote.rb, line 27
def practice_count
  return @chapters.sum do |chapter|
    chapter.sub_chapters.sum do |sub_chapter|
      sub_chapter.practices.count
    end
  end
end