Module: ContentBundles
- Defined in:
- lib/user/content/content_bundles.rb
Instance Method Summary collapse
-
#create_content_bundle(data, options = nil) ⇒ Object
Create content bundle.
-
#delete_content_bundle(id) ⇒ Object
Delete content bundle.
-
#get_content_bundle(id, options = nil) ⇒ Object
Get content bundle.
-
#get_content_bundles(options = nil, use_post = true) ⇒ Object
Get content bundle.
-
#update_content_bundle(id, data, options = nil) ⇒ Object
Update content bundle.
Instance Method Details
#create_content_bundle(data, options = nil) ⇒ Object
Create content bundle.
Create a content bundle with data.
Parameters
- data
-
(Hash) – Data to be submitted.
Example
data = {
user_id: 1,
slug: "new-content bundle",
content bundle_template_id: 1
}
options = { fields: 'id,slug' }
@data = @cxf_user.create_content_bundle(data, options)
63 64 65 |
# File 'lib/user/content/content_bundles.rb', line 63 def create_content_bundle(data, = nil) @client.raw('post', '/content/content-bundles', , data_transform(data)) end |
#delete_content_bundle(id) ⇒ Object
Delete content bundle.
Delete a content bundle.
Parameters
- id
-
(Integer) – content bundle id.
Example
@data = @cxf_user.delete_content_bundle(6)
92 93 94 |
# File 'lib/user/content/content_bundles.rb', line 92 def delete_content_bundle(id) @client.raw('delete', "/content/content-bundles/#{id}") end |
#get_content_bundle(id, options = nil) ⇒ Object
Get content bundle.
Get a content bundle info.
Parameters
- id
-
(Integer) – content bundle id.
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @cxf_user.get_content_bundle(1)
Second Example
= {
fields: 'id, slug'
}
@data = @cxf_user.get_content_bundle(1, )
43 44 45 |
# File 'lib/user/content/content_bundles.rb', line 43 def get_content_bundle(id, = nil) @client.raw('get', "/content/content-bundles/#{id}", ) end |
#get_content_bundles(options = nil, use_post = true) ⇒ Object
Get content bundle.
Get a collection of content bundle.
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_content_bundles
Second Example
= {
fields: 'id, slug'
}
@data = @cxf_user.get_content_bundles()
Third Example
= {
fields: 'id, slug'
}
@data = @cxf_user.get_content_bundles(, true)
24 25 26 |
# File 'lib/user/content/content_bundles.rb', line 24 def get_content_bundles( = nil, use_post = true) get_query_results('/content/content-bundles', , use_post) end |
#update_content_bundle(id, data, options = nil) ⇒ Object
Update content bundle.
Update a content bundle info.
Parameters
- id
-
(Integer) – content bundle id.
- data
-
(Hash) – Data to be submitted.
Example
data = {
user_id: 1,
slug: 'new-content bundle'
}
@data = @cxf_user.update_content_bundle(5, data)
80 81 82 |
# File 'lib/user/content/content_bundles.rb', line 80 def update_content_bundle(id, data, = nil) @client.raw('put', "/content/content-bundles/#{id}", , data_transform(data)) end |