Class: Kentico::Kontent::Delivery::Resolvers::ContentLink

Inherits:
Object
  • Object
show all
Defined in:
lib/delivery/resolvers/content_link_resolver.rb

Overview

Model for links from the JSON response

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject

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

#idObject

Returns the value of attribute id.



86
87
88
# File 'lib/delivery/resolvers/content_link_resolver.rb', line 86

def id
  @id
end

#typeObject

Returns the value of attribute type.



86
87
88
# File 'lib/delivery/resolvers/content_link_resolver.rb', line 86

def type
  @type
end

#url_slugObject

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