Class: Contentful::Link

Inherits:
BaseResource show all
Defined in:
lib/contentful/link.rb

Overview

Instance Attribute Summary

Attributes inherited from BaseResource

#_metadata, #default_locale, #raw, #sys

Instance Method Summary collapse

Methods inherited from BaseResource

#==, #initialize, #inspect, #marshal_dump, #marshal_load, #reload

Constructor Details

This class inherits a constructor from Contentful::BaseResource

Instance Method Details

#resolve(client, query = {}) ⇒ Object

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



9
10
11
12
13
14
15
# File 'lib/contentful/link.rb', line 9

def resolve(client, 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