Class: Contentful::Link

Inherits:
Object
  • Object
show all
Includes:
Resource, Resource::SystemProperties
Defined in:
lib/contentful/link.rb

Overview

Instance Attribute Summary

Attributes included from Resource::SystemProperties

#sys

Attributes included from Resource

#client, #default_locale, #properties, #raw, #request

Instance Method Summary collapse

Methods included from Resource

#array?, #fields, #localized?, #reload, #sys

Instance Method Details

#resolve(query = {}) ⇒ Object

Queries contentful for the Resource the Link is refering to Takes an optional query hash



12
13
14
15
16
17
18
# File 'lib/contentful/link.rb', line 12

def resolve(query = {})
  id_and_query = [(id unless link_type == 'Space')].compact + [query]
  client.public_send(
    Contentful::Support.snakify(link_type).to_sym,
    *id_and_query
  )
end