Class: Kentico::Kontent::Delivery::Resolvers::ContentLink
- Inherits:
-
Object
- Object
- Kentico::Kontent::Delivery::Resolvers::ContentLink
- Defined in:
- lib/delivery/resolvers/content_link_resolver.rb
Overview
Model for links from the JSON response
Instance Attribute Summary collapse
-
#code_name ⇒ Object
Returns the value of attribute code_name.
-
#id ⇒ Object
Returns the value of attribute id.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url_slug ⇒ Object
Returns the value of attribute url_slug.
Instance Method Summary collapse
-
#initialize(link) ⇒ ContentLink
constructor
Constructor.
Constructor Details
#initialize(link) ⇒ ContentLink
Constructor.
-
Args:
-
link (
JSON
) One link from an element’s ‘links’ JSON node
-
92 93 94 95 96 97 |
# File 'lib/delivery/resolvers/content_link_resolver.rb', line 92 def initialize(link) self.id = link[0] self.code_name = link[1]['codename'] self.type = link[1]['type'] self.url_slug = link[1]['url_slug'] end |
Instance Attribute Details
#code_name ⇒ Object
Returns the value of attribute code_name.
86 87 88 |
# File 'lib/delivery/resolvers/content_link_resolver.rb', line 86 def code_name @code_name end |
#id ⇒ Object
Returns the value of attribute id.
86 87 88 |
# File 'lib/delivery/resolvers/content_link_resolver.rb', line 86 def id @id end |
#type ⇒ Object
Returns the value of attribute type.
86 87 88 |
# File 'lib/delivery/resolvers/content_link_resolver.rb', line 86 def type @type end |
#url_slug ⇒ Object
Returns the value of attribute url_slug.
86 87 88 |
# File 'lib/delivery/resolvers/content_link_resolver.rb', line 86 def url_slug @url_slug end |