Class: Bookbinder::Config::ProductConfig
- Inherits:
-
Object
- Object
- Bookbinder::Config::ProductConfig
- Defined in:
- lib/bookbinder/config/product_config.rb
Constant Summary collapse
- CONFIG_REQUIRED_KEYS =
%w(id subnav_topics)
Instance Attribute Summary collapse
-
#subnav_topics ⇒ Object
readonly
Returns the value of attribute subnav_topics.
Instance Method Summary collapse
- #id ⇒ Object (also: #subnav_name)
-
#initialize(config) ⇒ ProductConfig
constructor
A new instance of ProductConfig.
- #pdf_config ⇒ Object
- #specifies_subnav? ⇒ Boolean
- #subnav_exclusions ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(config) ⇒ ProductConfig
Returns a new instance of ProductConfig.
6 7 8 9 |
# File 'lib/bookbinder/config/product_config.rb', line 6 def initialize(config) @config = config = assemble_topics || [] end |
Instance Attribute Details
#subnav_topics ⇒ Object (readonly)
Returns the value of attribute subnav_topics.
33 34 35 |
# File 'lib/bookbinder/config/product_config.rb', line 33 def end |
Instance Method Details
#id ⇒ Object Also known as:
11 12 13 |
# File 'lib/bookbinder/config/product_config.rb', line 11 def id config['id'] end |
#pdf_config ⇒ Object
15 16 17 |
# File 'lib/bookbinder/config/product_config.rb', line 15 def pdf_config config['pdf_config'] end |
#specifies_subnav? ⇒ Boolean
23 24 25 |
# File 'lib/bookbinder/config/product_config.rb', line 23 def !.empty? end |
#subnav_exclusions ⇒ Object
19 20 21 |
# File 'lib/bookbinder/config/product_config.rb', line 19 def config['subnav_exclusions'] || [] end |
#valid? ⇒ Boolean
27 28 29 |
# File 'lib/bookbinder/config/product_config.rb', line 27 def valid? (CONFIG_REQUIRED_KEYS - config.keys).empty? end |