Class: Bookbinder::Config::SubnavConfig
- Inherits:
-
Object
- Object
- Bookbinder::Config::SubnavConfig
- Defined in:
- lib/bookbinder/config/subnav_config.rb
Constant Summary collapse
- CONFIG_REQUIRED_KEYS =
%w(name topics)
Instance Attribute Summary collapse
-
#topics ⇒ Object
readonly
Returns the value of attribute topics.
Instance Method Summary collapse
-
#initialize(config) ⇒ SubnavConfig
constructor
A new instance of SubnavConfig.
- #pdf_config ⇒ Object
- #subnav_exclusions ⇒ Object
- #subnav_name ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(config) ⇒ SubnavConfig
Returns a new instance of SubnavConfig.
6 7 8 9 |
# File 'lib/bookbinder/config/subnav_config.rb', line 6 def initialize(config) @config = config @topics = assemble_topics || [] end |
Instance Attribute Details
#topics ⇒ Object (readonly)
Returns the value of attribute topics.
29 30 31 |
# File 'lib/bookbinder/config/subnav_config.rb', line 29 def topics @topics end |
Instance Method Details
#pdf_config ⇒ Object
15 16 17 |
# File 'lib/bookbinder/config/subnav_config.rb', line 15 def pdf_config config['pdf_config'] end |
#subnav_exclusions ⇒ Object
19 20 21 |
# File 'lib/bookbinder/config/subnav_config.rb', line 19 def config['subnav_exclusions'] || [] end |
#subnav_name ⇒ Object
11 12 13 |
# File 'lib/bookbinder/config/subnav_config.rb', line 11 def config['name'] end |
#valid? ⇒ Boolean
23 24 25 |
# File 'lib/bookbinder/config/subnav_config.rb', line 23 def valid? (CONFIG_REQUIRED_KEYS - config.keys).empty? end |