Class: Pageflow::InternalLinks::PageLinks
- Inherits:
-
Struct
- Object
- Struct
- Pageflow::InternalLinks::PageLinks
- Defined in:
- app/helpers/pageflow/internal_links/page_links.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#entry ⇒ Object
Returns the value of attribute entry.
-
#template ⇒ Object
Returns the value of attribute template.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration
3 4 5 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 3 def configuration @configuration end |
#entry ⇒ Object
Returns the value of attribute entry
3 4 5 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 3 def entry @entry end |
#template ⇒ Object
Returns the value of attribute template
3 4 5 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 3 def template @template end |
Class Method Details
.deserialize(template, entry, configuration) ⇒ Object
4 5 6 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 4 def self.deserialize(template, entry, configuration) new(template, entry, configuration).deserialize end |
Instance Method Details
#deserialize ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 8 def deserialize page_links = parse pages_by_perma_id = entry.pages .where(perma_id: page_links.map(&:target_page_id)) .index_by(&:perma_id) page_links.each do |page_link| page_link.target_page = pages_by_perma_id[page_link.target_page_id] end end |