Class: Bindery::Division
- Inherits:
-
Object
- Object
- Bindery::Division
- Includes:
- ContentMethods
- Defined in:
- lib/bindery/division.rb
Instance Attribute Summary collapse
-
#div_type ⇒ Object
Returns the value of attribute div_type.
-
#file ⇒ Object
Returns the value of attribute file.
-
#options ⇒ Object
Returns the value of attribute options.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #body_only? ⇒ Boolean
- #divisions ⇒ Object
- #include_images? ⇒ Boolean
-
#initialize(div_type, title, file, options) ⇒ Division
constructor
A new instance of Division.
- #valid? ⇒ Boolean
Methods included from ContentMethods
#appendix, #chapter, #div, #part, #section
Constructor Details
#initialize(div_type, title, file, options) ⇒ Division
Returns a new instance of Division.
10 11 12 13 14 15 |
# File 'lib/bindery/division.rb', line 10 def initialize(div_type, title, file, ) self.div_type = div_type self.title = title self.file = file self. = end |
Instance Attribute Details
#div_type ⇒ Object
Returns the value of attribute div_type.
3 4 5 |
# File 'lib/bindery/division.rb', line 3 def div_type @div_type end |
#file ⇒ Object
Returns the value of attribute file.
4 5 6 |
# File 'lib/bindery/division.rb', line 4 def file @file end |
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/bindery/division.rb', line 6 def @options end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/bindery/division.rb', line 5 def title @title end |
Instance Method Details
#body_only? ⇒ Boolean
35 36 37 |
# File 'lib/bindery/division.rb', line 35 def body_only? .fetch(:body_only, true) end |
#divisions ⇒ Object
31 32 33 |
# File 'lib/bindery/division.rb', line 31 def divisions @divisions ||= [] end |
#include_images? ⇒ Boolean
39 40 41 |
# File 'lib/bindery/division.rb', line 39 def include_images? .fetch(:include_images, true) end |
#valid? ⇒ Boolean
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/bindery/division.rb', line 17 def valid? true # ??? title specified? Is this required by the spec? Think about # in what sense a chapter needs a title. Wouldn't it be nice # if (say) Pratchett's books could be broken up a bit even # though he doesn't have titled chapters? Aren't there books # with actual chapters but no titles? Does epub provide # another way to provide subdivisions without separate # chapters that would break up the text flow? # file exists, readable # file content properly formed? Does that matter? Can we # verify it? end |