Class: Jekyll::AwesomeNav::Config
- Inherits:
-
Object
- Object
- Jekyll::AwesomeNav::Config
- Defined in:
- lib/jekyll/awesome_nav/config.rb
Constant Summary collapse
- DEFAULTS =
{ "enabled" => true, "root" => "docs", "nav_filename" => ".nav.yml" }.freeze
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#initialize(raw_config) ⇒ Config
constructor
A new instance of Config.
- #nav_filename ⇒ Object
- #root_dir ⇒ Object
Constructor Details
#initialize(raw_config) ⇒ Config
Returns a new instance of Config.
12 13 14 15 16 |
# File 'lib/jekyll/awesome_nav/config.rb', line 12 def initialize(raw_config) raise Error, "awesome_nav config must be a mapping" unless raw_config.nil? || raw_config.is_a?(Hash) @data = DEFAULTS.merge(raw_config || {}) end |
Instance Method Details
#enabled? ⇒ Boolean
18 19 20 |
# File 'lib/jekyll/awesome_nav/config.rb', line 18 def enabled? @data["enabled"] end |
#nav_filename ⇒ Object
26 27 28 |
# File 'lib/jekyll/awesome_nav/config.rb', line 26 def nav_filename @data["nav_filename"].to_s end |
#root_dir ⇒ Object
22 23 24 |
# File 'lib/jekyll/awesome_nav/config.rb', line 22 def root_dir Utils.normalize_dir(@data["root"]) end |