Module: Contentful::Management::Resource::Refresher

Included in:
ApiKey, Asset, ContentType, Entry, Locale, Space, Webhook
Defined in:
lib/contentful/management/resource/refresher.rb

Overview

Adds the feature to have properties and system data reload for Resource.

Instance Method Summary collapse

Instance Method Details

#reloadObject

Reload an object Updates the current version of the object to the version on the system



8
9
10
11
12
# File 'lib/contentful/management/resource/refresher.rb', line 8

def reload
  self_class = self.class
  resource = self.is_a?(Space) ? self_class.find(client, id) : self_class.find(client, space.id, id)
  refresh_data(resource) if resource.is_a? self_class
end