Class: Bookwatch::Config::ProductConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/bookwatch/config/product_config.rb

Constant Summary collapse

CONFIG_REQUIRED_KEYS =
%w(id)

Instance Method Summary collapse

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

#idObject Also known as: subnav_name



8
9
10
# File 'lib/bookwatch/config/product_config.rb', line 8

def id
  config['id']
end

#pdf_configObject



12
13
14
# File 'lib/bookwatch/config/product_config.rb', line 12

def pdf_config
  config['pdf_config']
end


16
17
18
# File 'lib/bookwatch/config/product_config.rb', line 16

def subnav_root
  config['subnav_root']
end

#valid?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/bookwatch/config/product_config.rb', line 20

def valid?
  (CONFIG_REQUIRED_KEYS - config.keys).empty?
end