Class: Kentico::Kontent::Delivery::Resolvers::LinkedItemResolver
- Inherits:
-
Object
- Object
- Kentico::Kontent::Delivery::Resolvers::LinkedItemResolver
- Defined in:
- lib/delivery/resolvers/linked_item_resolver.rb
Overview
Resolves a content item by its codename. It contains the modular content of item/items response.
Instance Method Summary collapse
-
#initialize(modular_content, content_link_url_resolver, inline_content_item_resolver) ⇒ LinkedItemResolver
constructor
A new instance of LinkedItemResolver.
-
#resolve(codename) ⇒ Object
Resolves a content item.
Constructor Details
#initialize(modular_content, content_link_url_resolver, inline_content_item_resolver) ⇒ LinkedItemResolver
Returns a new instance of LinkedItemResolver.
8 9 10 11 12 13 |
# File 'lib/delivery/resolvers/linked_item_resolver.rb', line 8 def initialize(modular_content, content_link_url_resolver, inline_content_item_resolver) @modular_content = modular_content @content_link_url_resolver = content_link_url_resolver @inline_content_item_resolver = inline_content_item_resolver @resolved_items = {} end |
Instance Method Details
#resolve(codename) ⇒ Object
Resolves a content item. If the link for a codename was resolved before, it returns the same instance of ContentItem.
-
Args:
-
codename (
string
) Codename of the content item
-
-
Return:
-
Kentico::Kontent::Delivery::ContentItem
-
23 24 25 |
# File 'lib/delivery/resolvers/linked_item_resolver.rb', line 23 def resolve(codename) @resolved_items[codename] ||= resolve_item(codename) end |