Class: Lookbook::PageSectionEntity Private

Inherits:
PageEntity show all
Defined in:
lib/lookbook/entities/page_section_entity.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Represents a documentation page section.

Instance Attribute Summary collapse

Attributes inherited from PageEntity

#content, #sections

Instance Method Summary collapse

Methods inherited from PageEntity

#add_section, #data, #docs_path, #footer?, #header?, #markdown?, #method_missing, #respond_to_missing?, #search_terms, #title

Methods inherited from Entity

#<=>, #id, #label, #search_terms, #type

Constructor Details

#initialize(file_path) ⇒ PageSectionEntity

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of PageSectionEntity.



9
10
11
12
13
# File 'lib/lookbook/entities/page_section_entity.rb', line 9

def initialize(file_path)
  @file_path = Pathname(file_path)
  @parent = nil
  super
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Lookbook::PageEntity

Instance Attribute Details

#parentObject Also known as: page

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
# File 'lib/lookbook/entities/page_section_entity.rb', line 7

def parent
  @parent
end

Instance Method Details

#landing?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


28
29
30
# File 'lib/lookbook/entities/page_section_entity.rb', line 28

def landing?
  false
end

#lookup_pathObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
22
23
24
25
26
# File 'lib/lookbook/entities/page_section_entity.rb', line 19

def lookup_path
  directory = if relative_directory_path.present? && !relative_directory_path.to_s.start_with?(".")
    relative_directory_path
  end

  path = PathUtils.to_path(directory, name_parts[:parent_name])
  PathUtils.to_lookup_path(path)
end

#nameObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



15
16
17
# File 'lib/lookbook/entities/page_section_entity.rb', line 15

def name
  Utils.name(name_parts[:name])
end

#url_pathObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



32
33
34
# File 'lib/lookbook/entities/page_section_entity.rb', line 32

def url_path
  nil
end