Module: Pages
- Included in:
- Content
- Defined in:
- lib/user/content/pages.rb
Instance Method Summary collapse
-
#create_page(data) ⇒ Object
Create page.
-
#delete_page(id) ⇒ Object
Delete page.
-
#get_bundles(options = nil) ⇒ Object
Get bundles.
-
#get_page(id) ⇒ Object
Get page.
-
#get_page_groups ⇒ Object
Get page groups.
-
#get_pages(options = nil) ⇒ Object
Get pages.
-
#update_page(id, data) ⇒ Object
Update page.
Instance Method Details
#create_page(data) ⇒ Object
Create page.
Create a content page with data.
Parameters
- data
-
(Hash) – Data to be submitted.
Example
data = {
title: "New Page",
slug: "new-page-slug",
description: "New page description"
}
@data = @mints_user.create_page(data)
61 62 63 |
# File 'lib/user/content/pages.rb', line 61 def create_page(data) @client.raw('post', '/content/pages', nil, data_transform(data)) end |
#delete_page(id) ⇒ Object
Delete page.
Delete a content page.
Parameters
- id
-
(Integer) – Page id.
Example
@mints_user.@mints_user.delete_page(3)
89 90 91 |
# File 'lib/user/content/pages.rb', line 89 def delete_page(id) @client.raw('delete', "/content/pages/#{id}") end |
#get_bundles(options = nil) ⇒ Object
Get bundles.
Get a collection of content pages.
Example
@data = @mints_user.get_pages
32 33 34 |
# File 'lib/user/content/pages.rb', line 32 def get_bundles( = nil) @client.raw('get', '/content/pages', ) end |
#get_page(id) ⇒ Object
Get page.
Get a content page.
Parameters
- id
-
(Integer) – Page id.
Example
@data = @mints_user.get_page(1)
44 45 46 |
# File 'lib/user/content/pages.rb', line 44 def get_page(id) @client.raw('get', "/content/pages/#{id}") end |
#get_page_groups ⇒ Object
Get page groups.
Get content page groups.
Example
@data = @mints_user.get_page_groups
14 15 16 |
# File 'lib/user/content/pages.rb', line 14 def get_page_groups @client.raw('get', '/content/pages/groups') end |
#get_pages(options = nil) ⇒ Object
Get pages.
Get a collection of content pages.
Example
@data = @mints_user.get_pages
23 24 25 |
# File 'lib/user/content/pages.rb', line 23 def get_pages( = nil) @client.raw('get', '/content/pages', ) end |
#update_page(id, data) ⇒ Object
Update page.
Update a content page info.
Parameters
- id
-
(Integer) – Page id.
- data
-
(Hash) – Data to be submitted.
Example
data = {
title: "New Page Modified"
}
@data = @mints_user.update_page(5, data.to_json)
77 78 79 |
# File 'lib/user/content/pages.rb', line 77 def update_page(id, data) @client.raw('put', "/content/pages/#{id}", nil, data) end |