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 submitted.

Example

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


59
60
61
# File 'lib/user/content/pages.rb', line 59

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)


87
88
89
# File 'lib/user/content/pages.rb', line 87

def delete_page(id)
    return @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


30
31
32
# File 'lib/user/content/pages.rb', line 30

def get_bundles(options = nil)
    return @client.raw("get", "/content/pages", options)
end

#get_page(id) ⇒ Object

Get page.

Get a content page.

Parameters

id

(Integer) – Page id.

Example

@data = @mints_user.get_page(1)


42
43
44
# File 'lib/user/content/pages.rb', line 42

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


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

def get_page_groups
    return @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


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

def get_pages(options = nil)
    return @client.raw("get", "/content/pages", options)
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)


75
76
77
# File 'lib/user/content/pages.rb', line 75

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