Module: Contentful::Management::Resource::Archiver
Overview
Wrapper for Resources with /archived API
Instance Method Summary collapse
-
#archive ⇒ Contentful::Management::Resource
Archives a resource.
-
#archived? ⇒ Boolean
Checks if a resource is archived.
-
#unarchive ⇒ Contentful::Management::Resource
Unarchives a resource.
Instance Method Details
#archive ⇒ Contentful::Management::Resource
Archives a resource.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/contentful/management/resource/archiver.rb', line 11 def archive ResourceRequester.new(client, self.class).archive( self, { space_id: space.id, environment_id: environment_id, resource_id: id, suffix: '/archived' }, version: sys[:version] ) end |
#archived? ⇒ Boolean
Checks if a resource is archived.
43 44 45 |
# File 'lib/contentful/management/resource/archiver.rb', line 43 def archived? sys[:archivedAt] ? true : false end |
#unarchive ⇒ Contentful::Management::Resource
Unarchives a resource.
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/contentful/management/resource/archiver.rb', line 27 def unarchive ResourceRequester.new(client, self.class).unarchive( self, { space_id: space.id, environment_id: environment_id, resource_id: id, suffix: '/archived' }, version: sys[:version] ) end |