Class: DocsKit::Registry::Entry
- Inherits:
-
Object
- Object
- DocsKit::Registry::Entry
- Defined in:
- lib/docs_kit/registry.rb
Overview
The default instance for a v2 page entry: readers + href + view_class
resolved under the registry's view_namespace (nil until the class exists,
preserving the no-dead-links behavior).
Instance Attribute Summary collapse
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#view_name ⇒ Object
readonly
Returns the value of attribute view_name.
Instance Method Summary collapse
-
#initialize(attrs, path_prefix, view_namespace) ⇒ Entry
constructor
A new instance of Entry.
-
#view_class ⇒ Object
The authored Phlex page class, or nil until it's written.
Constructor Details
#initialize(attrs, path_prefix, view_namespace) ⇒ Entry
Returns a new instance of Entry.
134 135 136 137 138 139 140 141 142 |
# File 'lib/docs_kit/registry.rb', line 134 def initialize(attrs, path_prefix, view_namespace) @slug = attrs[:slug] @title = attrs[:title] @group = attrs[:group] @icon = attrs[:icon] @view_name = attrs[:view] @view_namespace = view_namespace @href = "#{path_prefix}/#{@slug}" end |
Instance Attribute Details
#group ⇒ Object (readonly)
Returns the value of attribute group.
132 133 134 |
# File 'lib/docs_kit/registry.rb', line 132 def group @group end |
#href ⇒ Object (readonly)
Returns the value of attribute href.
132 133 134 |
# File 'lib/docs_kit/registry.rb', line 132 def href @href end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
132 133 134 |
# File 'lib/docs_kit/registry.rb', line 132 def icon @icon end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
132 133 134 |
# File 'lib/docs_kit/registry.rb', line 132 def slug @slug end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
132 133 134 |
# File 'lib/docs_kit/registry.rb', line 132 def title @title end |
#view_name ⇒ Object (readonly)
Returns the value of attribute view_name.
132 133 134 |
# File 'lib/docs_kit/registry.rb', line 132 def view_name @view_name end |
Instance Method Details
#view_class ⇒ Object
The authored Phlex page class, or nil until it's written.
145 146 147 148 149 |
# File 'lib/docs_kit/registry.rb', line 145 def view_class return unless @view_namespace "#{@view_namespace}::#{@view_name}".safe_constantize end |