Class: Bookwatch::Config::ProductConfig
- Inherits:
-
Object
- Object
- Bookwatch::Config::ProductConfig
- Defined in:
- lib/bookwatch/config/product_config.rb
Constant Summary collapse
- CONFIG_REQUIRED_KEYS =
%w(id)
Instance Method Summary collapse
- #id ⇒ Object (also: #subnav_name)
-
#initialize(config) ⇒ ProductConfig
constructor
A new instance of ProductConfig.
- #pdf_config ⇒ Object
- #subnav_root ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(config) ⇒ ProductConfig
Returns a new instance of ProductConfig.
4 5 6 |
# File 'lib/bookwatch/config/product_config.rb', line 4 def initialize(config) @config = config end |
Instance Method Details
#id ⇒ Object Also known as:
8 9 10 |
# File 'lib/bookwatch/config/product_config.rb', line 8 def id config['id'] end |
#pdf_config ⇒ Object
12 13 14 |
# File 'lib/bookwatch/config/product_config.rb', line 12 def pdf_config config['pdf_config'] end |
#subnav_root ⇒ Object
16 17 18 |
# File 'lib/bookwatch/config/product_config.rb', line 16 def config['subnav_root'] end |
#valid? ⇒ Boolean
20 21 22 |
# File 'lib/bookwatch/config/product_config.rb', line 20 def valid? (CONFIG_REQUIRED_KEYS - config.keys).empty? end |