Class: Jekyll::AwesomeNav::NavFileOptions
- Inherits:
-
Object
- Object
- Jekyll::AwesomeNav::NavFileOptions
- Defined in:
- lib/jekyll/awesome_nav/nav_file_options.rb
Constant Summary collapse
- UNSET =
Object.new.freeze
Instance Attribute Summary collapse
-
#ignore_patterns ⇒ Object
readonly
Returns the value of attribute ignore_patterns.
-
#sort_options ⇒ Object
readonly
Returns the value of attribute sort_options.
Class Method Summary collapse
Instance Method Summary collapse
- #append_unmatched_or(inherited) ⇒ Object
- #hide? ⇒ Boolean
- #ignore_patterns_or(inherited) ⇒ Object
-
#initialize(append_unmatched: UNSET, hide: UNSET, ignore: UNSET, sort: UNSET) ⇒ NavFileOptions
constructor
A new instance of NavFileOptions.
- #sort_options_or(inherited) ⇒ Object
Constructor Details
#initialize(append_unmatched: UNSET, hide: UNSET, ignore: UNSET, sort: UNSET) ⇒ NavFileOptions
Returns a new instance of NavFileOptions.
19 20 21 22 23 24 |
# File 'lib/jekyll/awesome_nav/nav_file_options.rb', line 19 def initialize(append_unmatched: UNSET, hide: UNSET, ignore: UNSET, sort: UNSET) @append_unmatched = append_unmatched @hide = hide @ignore_patterns = ignore == UNSET ? UNSET : normalize_ignore_patterns(ignore) @sort_options = sort == UNSET ? UNSET : SortOptions.from(sort) end |
Instance Attribute Details
#ignore_patterns ⇒ Object (readonly)
Returns the value of attribute ignore_patterns.
8 9 10 |
# File 'lib/jekyll/awesome_nav/nav_file_options.rb', line 8 def ignore_patterns @ignore_patterns end |
#sort_options ⇒ Object (readonly)
Returns the value of attribute sort_options.
8 9 10 |
# File 'lib/jekyll/awesome_nav/nav_file_options.rb', line 8 def @sort_options end |
Class Method Details
.from(data) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/jekyll/awesome_nav/nav_file_options.rb', line 10 def self.from(data) new( append_unmatched: data.key?("append_unmatched") ? data["append_unmatched"] : UNSET, hide: data.key?("hide") ? data["hide"] : UNSET, ignore: data.key?("ignore") ? data["ignore"] : UNSET, sort: data.key?("sort") ? data["sort"] : UNSET ) end |
Instance Method Details
#append_unmatched_or(inherited) ⇒ Object
26 27 28 29 30 |
# File 'lib/jekyll/awesome_nav/nav_file_options.rb', line 26 def append_unmatched_or(inherited) return inherited if @append_unmatched == UNSET !!@append_unmatched end |
#hide? ⇒ Boolean
44 45 46 |
# File 'lib/jekyll/awesome_nav/nav_file_options.rb', line 44 def hide? @hide != UNSET && !!@hide end |
#ignore_patterns_or(inherited) ⇒ Object
32 33 34 35 36 |
# File 'lib/jekyll/awesome_nav/nav_file_options.rb', line 32 def ignore_patterns_or(inherited) return inherited if @ignore_patterns == UNSET @ignore_patterns end |
#sort_options_or(inherited) ⇒ Object
38 39 40 41 42 |
# File 'lib/jekyll/awesome_nav/nav_file_options.rb', line 38 def (inherited) return inherited if @sort_options == UNSET @sort_options end |