Module: PrintVersions
- Included in:
- Content
- Defined in:
- lib/user/content/print_versions.rb
Instance Method Summary collapse
-
#create_print_version(data, options = nil) ⇒ Object
Create print version.
-
#create_print_version_from_print_version(id, data, options = nil) ⇒ Object
Create print version from existing print version.
-
#delete_print_version(id) ⇒ Object
Delete print version.
-
#duplicate_print_version(id, data) ⇒ Object
Duplicate print version.
-
#get_print_version(id, options = nil) ⇒ Object
Get print version.
-
#get_print_versions(options = nil, use_post = true) ⇒ Object
Get print versions.
-
#publish_print_version(id, data) ⇒ Object
Publish print version.
-
#update_print_version(id, data, options = nil) ⇒ Object
Update print version.
Instance Method Details
#create_print_version(data, options = nil) ⇒ Object
Create print version.
Create a print version with data.
Parameters
- data
-
(Hash) – Data to be submitted.
Example
data = {
title: 'New print',
slug: 'new-print',
social_metadata: 'social metadata'
}
@data = @cxf_user.create_print_version(data)
61 62 63 |
# File 'lib/user/content/print_versions.rb', line 61 def create_print_version(data, = nil) @client.raw('post', '/content/print-versions', , data_transform(data)) end |
#create_print_version_from_print_version(id, data, options = nil) ⇒ Object
Create print version from existing print version.
Create a new print version using data from an existing print version.
Parameters
- id
-
(Integer) – print version id.
- data
-
(Hash) – Data to be submitted.
- options
-
(Hash) – Optional parameters for the request.
Example
data = {
title: 'Copied print',
slug: 'copied-print'
}
@data = @cxf_user.create_print_version_from_print_version(1, data)
79 80 81 |
# File 'lib/user/content/print_versions.rb', line 79 def create_print_version_from_print_version(id, data, = nil) @client.raw('post', "/content/print-versions/#{id}/print-version", , data_transform(data)) end |
#delete_print_version(id) ⇒ Object
Delete print version.
Delete a print version.
Parameters
- id
-
(Integer) – print version id.
Example
@data = @cxf_user.delete_print_version(6)
113 114 115 |
# File 'lib/user/content/print_versions.rb', line 113 def delete_print_version(id) @client.raw('delete', "/content/print-versions/#{id}") end |
#duplicate_print_version(id, data) ⇒ Object
Duplicate print version.
Duplicate a print version.
Parameters
- id
-
(Integer) – print version id.
- data
-
(Hash) – Data to be submitted.
Example
data = { options: [] }
@data = @cxf_user.duplicate_print_version(1, data.to_json)
127 128 129 |
# File 'lib/user/content/print_versions.rb', line 127 def duplicate_print_version(id, data) @client.raw('post', "/content/print-versions/#{id}/duplicate", nil, data) end |
#get_print_version(id, options = nil) ⇒ Object
Get print version.
Get a print version info.
Parameters
- id
-
(Integer) – print version id.
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @cxf_user.get_print_version(1)
Second Example
= {
fields: 'id, title'
}
@data = @cxf_user.get_print_version(1, )
44 45 46 |
# File 'lib/user/content/print_versions.rb', line 44 def get_print_version(id, = nil) @client.raw('get', "/content/print-versions/#{id}", ) end |
#get_print_versions(options = nil, use_post = true) ⇒ Object
Get print versions.
Get a collection of print versions.
Parameters
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
- use_post
-
(Boolean) – Variable to determine if the request is by ‘post’ or ‘get’ functions.
First Example
@data = @cxf_user.get_print_versions
Second Example
= {
fields: 'id, title'
}
@data = @cxf_user.get_print_versions()
Third Example
= {
fields: 'id, title'
}
@data = @cxf_user.get_print_versions(, true)
25 26 27 |
# File 'lib/user/content/print_versions.rb', line 25 def get_print_versions( = nil, use_post = true) get_query_results('/content/print-versions', , use_post) end |
#publish_print_version(id, data) ⇒ Object
Publish print version.
Publish a print version.
Parameters
- id
-
(Integer) – print version id.
- data
-
(Hash) – Data to be submitted.
Example
data = {
title: 'New print Modified',
slug: 'new-print'
}
@data = @cxf_user.publish_print_version(1, data.to_json)
144 145 146 |
# File 'lib/user/content/print_versions.rb', line 144 def publish_print_version(id, data) @client.raw('put', "/content/print-versions/#{id}/publish", nil, data) end |
#update_print_version(id, data, options = nil) ⇒ Object
Update print version.
Update a print version info.
Parameters
- id
-
(Integer) – print version id.
- data
-
(Hash) – Data to be submitted.
Example
data = {
title: 'New print Modified',
slug: 'new-print'
}
@data = @cxf_user.update_print_version(5, data)
101 102 103 |
# File 'lib/user/content/print_versions.rb', line 101 def update_print_version(id, data, = nil) @client.raw('put', "/content/print-versions/#{id}", , data_transform(data)) end |