Class: PnoteClient::Documents::Pnote::Chapter

Inherits:
Object
  • Object
show all
Defined in:
lib/pnote_client/documents/pnote/chapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title: nil) ⇒ Chapter

Returns a new instance of Chapter.



7
8
9
10
11
# File 'lib/pnote_client/documents/pnote/chapter.rb', line 7

def initialize(title: nil)
  @title = title
  @sub_chapters = []
  @practices = []
end

Instance Attribute Details

#practicesObject (readonly)

Returns the value of attribute practices.



5
6
7
# File 'lib/pnote_client/documents/pnote/chapter.rb', line 5

def practices
  @practices
end

#sub_chaptersObject (readonly)

Returns the value of attribute sub_chapters.



5
6
7
# File 'lib/pnote_client/documents/pnote/chapter.rb', line 5

def sub_chapters
  @sub_chapters
end

#titleObject (readonly)

Returns the value of attribute title.



5
6
7
# File 'lib/pnote_client/documents/pnote/chapter.rb', line 5

def title
  @title
end

Instance Method Details

#add_practice(new_practice) ⇒ Object



21
22
23
# File 'lib/pnote_client/documents/pnote/chapter.rb', line 21

def add_practice(new_practice)
  @practices << new_practice
end

#add_sub_chapter(new_sub_chapter) ⇒ Object



17
18
19
# File 'lib/pnote_client/documents/pnote/chapter.rb', line 17

def add_sub_chapter(new_sub_chapter)
  @sub_chapters << new_sub_chapter
end

#set_title(title) ⇒ Object



13
14
15
# File 'lib/pnote_client/documents/pnote/chapter.rb', line 13

def set_title(title)
  @title = title
end