Class: Bookwatch::Config::SectionConfig

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

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ SectionConfig

Returns a new instance of SectionConfig.



6
7
8
# File 'lib/bookwatch/config/section_config.rb', line 6

def initialize(config)
  @config = config
end

Instance Method Details

#==(other) ⇒ Object



56
57
58
# File 'lib/bookwatch/config/section_config.rb', line 56

def ==(other)
  config == other.instance_variable_get(:@config)
end

#at_repo_pathObject



38
39
40
# File 'lib/bookwatch/config/section_config.rb', line 38

def at_repo_path
  repo['at_path']
end

#dependent_sectionsObject



46
47
48
49
50
# File 'lib/bookwatch/config/section_config.rb', line 46

def dependent_sections
  @sections ||= (config['dependent_sections'] || []).map do |dep_section|
    SectionConfig.new(dep_section)
  end
end

#desired_directory_nameObject



18
19
20
# File 'lib/bookwatch/config/section_config.rb', line 18

def desired_directory_name
  config['directory']
end

#inspectObject



64
65
66
# File 'lib/bookwatch/config/section_config.rb', line 64

def inspect
  config.inspect
end

#merge(other_section_config) ⇒ Object



60
61
62
# File 'lib/bookwatch/config/section_config.rb', line 60

def merge(other_section_config)
  SectionConfig.new(config.merge(other_section_config.instance_variable_get(:@config)))
end

#no_docs?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/bookwatch/config/section_config.rb', line 42

def no_docs?
  config.fetch('no_docs', false)
end

#pdf_output_filenameObject



22
23
24
# File 'lib/bookwatch/config/section_config.rb', line 22

def pdf_output_filename
  config['output_filename']
end

#preprocessor_configObject



52
53
54
# File 'lib/bookwatch/config/section_config.rb', line 52

def preprocessor_config
  config.fetch('preprocessor_config', {})
end

#product_idObject Also known as: subnav_name



14
15
16
# File 'lib/bookwatch/config/section_config.rb', line 14

def product_id
  config['product_id']
end

#product_infoObject



70
71
72
73
# File 'lib/bookwatch/config/section_config.rb', line 70

def product_info
  return {} if config['product_info'].nil?
  config['product_info']
end

#repo_nameObject



26
27
28
# File 'lib/bookwatch/config/section_config.rb', line 26

def repo_name
  repo['name']
end

#repo_refObject



34
35
36
# File 'lib/bookwatch/config/section_config.rb', line 34

def repo_ref
  repo['ref'] || 'master'
end

#repo_urlObject



30
31
32
# File 'lib/bookwatch/config/section_config.rb', line 30

def repo_url
  Ingest::RepoIdentifier.new(repo['name'])
end


10
11
12
# File 'lib/bookwatch/config/section_config.rb', line 10

def subnav_template
  config['subnav_template']
end