Class: Bindery::Book
- Inherits:
-
Object
show all
- Defined in:
- lib/bindery/book.rb
Defined Under Namespace
Classes: DublinMetadata, Metadata
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
9
10
11
|
# File 'lib/bindery/book.rb', line 9
def author
@author
end
|
#isbn ⇒ Object
Returns the value of attribute isbn.
9
10
11
|
# File 'lib/bindery/book.rb', line 9
def isbn
@isbn
end
|
#language ⇒ Object
Returns the value of attribute language.
9
10
11
|
# File 'lib/bindery/book.rb', line 9
def language
@language
end
|
#output ⇒ Object
Returns the value of attribute output.
9
10
11
|
# File 'lib/bindery/book.rb', line 9
def output
@output
end
|
#subtitle ⇒ Object
Returns the value of attribute subtitle.
9
10
11
|
# File 'lib/bindery/book.rb', line 9
def subtitle
@subtitle
end
|
#title ⇒ Object
Returns the value of attribute title.
9
10
11
|
# File 'lib/bindery/book.rb', line 9
def title
@title
end
|
#url ⇒ Object
Returns the value of attribute url.
9
10
11
|
# File 'lib/bindery/book.rb', line 9
def url
@url
end
|
Instance Method Details
#configuration_valid? ⇒ Boolean
31
32
33
34
35
36
|
# File 'lib/bindery/book.rb', line 31
def configuration_valid?
true
end
|
#divisions ⇒ Object
19
20
21
|
# File 'lib/bindery/book.rb', line 19
def divisions
@divisions ||= []
end
|
#divisions_valid? ⇒ Boolean
44
45
46
|
# File 'lib/bindery/book.rb', line 44
def divisions_valid?
divisions.all?{|div| div.valid?} end
|
15
16
17
|
# File 'lib/bindery/book.rb', line 15
def formats
@formats ||= []
end
|
#full_title ⇒ Object
23
24
25
|
# File 'lib/bindery/book.rb', line 23
def full_title
title + (subtitle ? ": #{subtitle}" : '')
end
|
#generate ⇒ Object
48
49
50
51
52
53
|
# File 'lib/bindery/book.rb', line 48
def generate
formats.each do |format|
require "bindery/formats/#{format}"
::Bindery::Formats.const_get(format.to_s.capitalize).new(self).generate
end
end
|
11
12
13
|
# File 'lib/bindery/book.rb', line 11
def metadata
@metadata ||= []
end
|
38
39
40
41
42
|
# File 'lib/bindery/book.rb', line 38
def metadata_valid?
true
end
|
#valid? ⇒ Boolean
27
28
29
|
# File 'lib/bindery/book.rb', line 27
def valid?
configuration_valid? && metadata_valid? && divisions_valid?
end
|