Class: Markdowndocs::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/markdowndocs/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/markdowndocs/configuration.rb', line 10

def initialize
  @docs_path = nil # Resolved lazily so Rails.root is available
  @categories = {}
  @modes = %w[guide technical]
  @default_mode = "guide"
  @markdown_options = default_markdown_options
  @rouge_theme = "github"
  @cache_expiry = 1.hour
  @user_mode_resolver = nil
  @user_mode_saver = nil
  @search_enabled = false
  @layout = "markdowndocs/application"
end

Instance Attribute Details

#cache_expiryObject

Returns the value of attribute cache_expiry.



5
6
7
# File 'lib/markdowndocs/configuration.rb', line 5

def cache_expiry
  @cache_expiry
end

#categoriesObject

Returns the value of attribute categories.



5
6
7
# File 'lib/markdowndocs/configuration.rb', line 5

def categories
  @categories
end

#default_modeObject

Returns the value of attribute default_mode.



5
6
7
# File 'lib/markdowndocs/configuration.rb', line 5

def default_mode
  @default_mode
end

#docs_pathObject

Returns the value of attribute docs_path.



5
6
7
# File 'lib/markdowndocs/configuration.rb', line 5

def docs_path
  @docs_path
end

#layoutObject

Returns the value of attribute layout.



5
6
7
# File 'lib/markdowndocs/configuration.rb', line 5

def layout
  @layout
end

#markdown_optionsObject

Returns the value of attribute markdown_options.



5
6
7
# File 'lib/markdowndocs/configuration.rb', line 5

def markdown_options
  @markdown_options
end

#modesObject

Returns the value of attribute modes.



5
6
7
# File 'lib/markdowndocs/configuration.rb', line 5

def modes
  @modes
end

#rouge_themeObject

Returns the value of attribute rouge_theme.



5
6
7
# File 'lib/markdowndocs/configuration.rb', line 5

def rouge_theme
  @rouge_theme
end

#search_enabledObject

Returns the value of attribute search_enabled.



5
6
7
# File 'lib/markdowndocs/configuration.rb', line 5

def search_enabled
  @search_enabled
end

#user_mode_resolverObject

Returns the value of attribute user_mode_resolver.



5
6
7
# File 'lib/markdowndocs/configuration.rb', line 5

def user_mode_resolver
  @user_mode_resolver
end

#user_mode_saverObject

Returns the value of attribute user_mode_saver.



5
6
7
# File 'lib/markdowndocs/configuration.rb', line 5

def user_mode_saver
  @user_mode_saver
end

Instance Method Details

#resolved_docs_pathObject

Lazily resolve docs_path so Rails.root is available



25
26
27
# File 'lib/markdowndocs/configuration.rb', line 25

def resolved_docs_path
  @docs_path || Rails.root.join("app", "docs")
end