Class: Contentful::Link
- Inherits:
-
Object
- Object
- Contentful::Link
- Includes:
- Resource, Resource::SystemProperties
- Defined in:
- lib/contentful/link.rb
Overview
Resource Class for Links www.contentful.com/developers/documentation/content-delivery-api/#links
Instance Attribute Summary
Attributes included from Resource::SystemProperties
Attributes included from Resource
#client, #default_locale, #properties, #raw, #request
Instance Method Summary collapse
-
#resolve(query = {}) ⇒ Object
Queries contentful for the Resource the Link is refering to Takes an optional query hash.
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 |