Class: Lookbook::PageSection
- Defined in:
- lib/lookbook/page_section.rb
Constant Summary
Constants inherited from Page
Lookbook::Page::FRONTMATTER_FIELDS
Constants included from Utils
Utils::FRONTMATTER_REGEX, Utils::POSITION_PREFIX_REGEX
Instance Attribute Summary
Attributes inherited from Page
Instance Method Summary collapse
Methods inherited from Page
all, any?, #content, create, exists?, find, #footer?, #full_path, #get, #header?, #hidden, #hidden?, #initialize, #label, #markdown?, #matchers, #method_missing, page_paths, #parent_collections_names, #position, #respond_to_missing?, section_path?
Methods inherited from Entity
#hidden?, #hierarchy_depth, #initialize, #label, #matchers, #position
Constructor Details
This class inherits a constructor from Lookbook::Page
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Lookbook::Page
Instance Method Details
#id ⇒ Object
9 10 11 |
# File 'lib/lookbook/page_section.rb', line 9 def id "#{super}-#{name}" end |
#lookup_path ⇒ Object
25 26 27 |
# File 'lib/lookbook/page_section.rb', line 25 def lookup_path "#{super}/#{name}" end |
#name ⇒ Object
3 4 5 6 7 |
# File 'lib/lookbook/page_section.rb', line 3 def name return @name if @name.present? matches = full_path.to_s.match(%r{\[(?<name>\w+)\]}) @name ||= matches[:name] end |
#path ⇒ Object
17 18 19 |
# File 'lib/lookbook/page_section.rb', line 17 def path super.gsub("[#{name}]", "") end |
#type ⇒ Object
21 22 23 |
# File 'lib/lookbook/page_section.rb', line 21 def type :page_section end |
#url_path ⇒ Object
13 14 15 |
# File 'lib/lookbook/page_section.rb', line 13 def url_path nil end |