Module: Pages

Included in:
Content
Defined in:
lib/user/content/pages.rb

Instance Method Summary collapse

Instance Method Details

#create_page(data) ⇒ Object

Create page.

Create a content page with data.

Parameters

data

(Hash) – Data to be submited.

Example

data = { 
  "title": "New Page",
  "slug": "new-page-slug",
  "description": "New page description"
}
@data = @mints_user.create_page(data)
[View source]

50
51
52
# File 'lib/user/content/pages.rb', line 50

def create_page(data)
    return @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)
[View source]

78
79
80
# File 'lib/user/content/pages.rb', line 78

def delete_page(id)
    return @client.raw("delete", "/content/pages/#{id}")
end

#get_page(id) ⇒ Object

Get page.

Get a content page.

Parameters

id

(Integer) – Page id.

Example

@data = @mints_user.get_page(1)
[View source]

33
34
35
# File 'lib/user/content/pages.rb', line 33

def get_page(id)
    return @client.raw("get", "/content/pages/#{id}")
end

#get_page_groupsObject

Get page groups.

Get content page groups.

Example

@data = @mints_user.get_page_groups
[View source]

12
13
14
# File 'lib/user/content/pages.rb', line 12

def get_page_groups
    return @client.raw("get", "/content/pages/groups")
end

#get_pagesObject

Get pages.

Get a collection of content pages.

Example

@data = @mints_user.get_pages
[View source]

21
22
23
# File 'lib/user/content/pages.rb', line 21

def get_pages
    return @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 submited.

Example

data = { 
  "title": "New Page Modified"
}
@data = @mints_user.update_page(5, data.to_json)
[View source]

66
67
68
# File 'lib/user/content/pages.rb', line 66

def update_page(id, data)
    return @client.raw("put", "/content/pages/#{id}", nil, data)
end