Class: Bookingit::Config::Chapter
- Inherits:
-
Object
- Object
- Bookingit::Config::Chapter
- Defined in:
- lib/bookingit/config.rb
Instance Attribute Summary collapse
-
#markdown_path ⇒ Object
readonly
Returns the value of attribute markdown_path.
-
#next_chapter ⇒ Object
Returns the value of attribute next_chapter.
-
#previous_chapter ⇒ Object
Returns the value of attribute previous_chapter.
-
#relative_url ⇒ Object
readonly
Returns the value of attribute relative_url.
-
#sections ⇒ Object
readonly
Returns the value of attribute sections.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #add_section(title, anchor) ⇒ Object
-
#initialize(markdown_path: nil, relative_url: nil) ⇒ Chapter
constructor
A new instance of Chapter.
Constructor Details
#initialize(markdown_path: nil, relative_url: nil) ⇒ Chapter
Returns a new instance of Chapter.
77 78 79 80 81 |
# File 'lib/bookingit/config.rb', line 77 def initialize(markdown_path: nil, relative_url: nil) @markdown_path = markdown_path @relative_url = relative_url || (File.basename(markdown_path, File.extname(markdown_path)) + ".html") @sections = [] end |
Instance Attribute Details
#markdown_path ⇒ Object (readonly)
Returns the value of attribute markdown_path.
74 75 76 |
# File 'lib/bookingit/config.rb', line 74 def markdown_path @markdown_path end |
#next_chapter ⇒ Object
Returns the value of attribute next_chapter.
75 76 77 |
# File 'lib/bookingit/config.rb', line 75 def next_chapter @next_chapter end |
#previous_chapter ⇒ Object
Returns the value of attribute previous_chapter.
75 76 77 |
# File 'lib/bookingit/config.rb', line 75 def previous_chapter @previous_chapter end |
#relative_url ⇒ Object (readonly)
Returns the value of attribute relative_url.
74 75 76 |
# File 'lib/bookingit/config.rb', line 74 def relative_url @relative_url end |
#sections ⇒ Object (readonly)
Returns the value of attribute sections.
74 75 76 |
# File 'lib/bookingit/config.rb', line 74 def sections @sections end |
#title ⇒ Object
Returns the value of attribute title.
75 76 77 |
# File 'lib/bookingit/config.rb', line 75 def title @title end |