Class: Bindery::Chapter

Inherits:
Object
  • Object
show all
Defined in:
lib/bindery/chapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, file, options) ⇒ Chapter

Returns a new instance of Chapter.



7
8
9
10
11
# File 'lib/bindery/chapter.rb', line 7

def initialize(title, file, options)
  self.title = title
  self.file = file
  self.options = options
end

Instance Attribute Details

#fileObject

Returns the value of attribute file.



3
4
5
# File 'lib/bindery/chapter.rb', line 3

def file
  @file
end

#optionsObject

Returns the value of attribute options.



5
6
7
# File 'lib/bindery/chapter.rb', line 5

def options
  @options
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'lib/bindery/chapter.rb', line 4

def title
  @title
end

Instance Method Details

#body_only?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/bindery/chapter.rb', line 20

def body_only?
  options.fetch(:body_only, true)
end

#include_images?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/bindery/chapter.rb', line 24

def include_images?
  options.fetch(:include_images, true)
end

#valid?Boolean

Returns:

  • (Boolean)


13
14
15
16
17
18
# File 'lib/bindery/chapter.rb', line 13

def valid?
  true
  # title specified
  # file exists, readable
  # file content properly formed?  Does that matter?  Can we verify it?
end