Module: Betterdocs::Generator::ConfigShortcuts

Included in:
Markdown
Defined in:
lib/betterdocs/generator/config_shortcuts.rb

Instance Method Summary collapse

Instance Method Details

#api_base_urlObject



23
24
25
# File 'lib/betterdocs/generator/config_shortcuts.rb', line 23

def api_base_url
  config
end

#configObject



4
5
6
# File 'lib/betterdocs/generator/config_shortcuts.rb', line 4

def config
  Betterdocs::Global.config
end

#project_nameObject



8
9
10
# File 'lib/betterdocs/generator/config_shortcuts.rb', line 8

def project_name
  config.project_name
end

#section(name) ⇒ Object



17
18
19
20
21
# File 'lib/betterdocs/generator/config_shortcuts.rb', line 17

def section(name)
  name = name.to_sym
  config.section(name) or STDERR.puts "Section #{name.inspect} does not exist: Link in readme file won't work."
  "sections/#{name}"
end

#sectionsObject



12
13
14
15
# File 'lib/betterdocs/generator/config_shortcuts.rb', line 12

def sections
  Dir[config.api_controllers.to_s].each(&method(:load))
  config.sections
end