Class: PnoteClient::Documents::Pnote::Chapter
- Inherits:
-
Object
- Object
- PnoteClient::Documents::Pnote::Chapter
- Defined in:
- lib/pnote_client/documents/pnote/chapter.rb
Instance Attribute Summary collapse
-
#practices ⇒ Object
readonly
Returns the value of attribute practices.
-
#sub_chapters ⇒ Object
readonly
Returns the value of attribute sub_chapters.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #add_practice(new_practice) ⇒ Object
- #add_sub_chapter(new_sub_chapter) ⇒ Object
-
#initialize(title: nil) ⇒ Chapter
constructor
A new instance of Chapter.
- #set_title(title) ⇒ Object
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
#practices ⇒ Object (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_chapters ⇒ Object (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 |
#title ⇒ Object (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 |