Class: Jekyll::Llms::Entry
- Inherits:
-
Object
- Object
- Jekyll::Llms::Entry
- Defined in:
- lib/jekyll/llms/entry.rb
Instance Attribute Summary collapse
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#section ⇒ Object
readonly
Returns the value of attribute section.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #description ⇒ Object
- #enabled? ⇒ Boolean
- #excluded_by?(patterns) ⇒ Boolean
-
#initialize(site:, item:, section:) ⇒ Entry
constructor
A new instance of Entry.
- #title ⇒ Object
Constructor Details
Instance Attribute Details
#item ⇒ Object (readonly)
Returns the value of attribute item.
6 7 8 |
# File 'lib/jekyll/llms/entry.rb', line 6 def item @item end |
#section ⇒ Object (readonly)
Returns the value of attribute section.
6 7 8 |
# File 'lib/jekyll/llms/entry.rb', line 6 def section @section end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/jekyll/llms/entry.rb', line 6 def url @url end |
Instance Method Details
#description ⇒ Object
14 15 16 |
# File 'lib/jekyll/llms/entry.rb', line 14 def description item.data.fetch("description", "").strip end |
#enabled? ⇒ Boolean
18 19 20 |
# File 'lib/jekyll/llms/entry.rb', line 18 def enabled? item.data.fetch("llms", true) end |
#excluded_by?(patterns) ⇒ Boolean
22 23 24 25 26 |
# File 'lib/jekyll/llms/entry.rb', line 22 def excluded_by?(patterns) patterns.any? do |pattern| url.matches?(pattern) end end |
#title ⇒ Object
28 29 30 31 32 33 |
# File 'lib/jekyll/llms/entry.rb', line 28 def title title = item.data.fetch("title", "").strip return title unless title.empty? fallback_title end |