Class: PagiiiApi::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/pagiii_api/page.rb

Class Method Summary collapse

Class Method Details

.create(options) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/pagiii_api/page.rb', line 4

def create(options)
  conn = Pagiii.create_connection

  response = conn.post("/api/v1/admin/pages") do |req|
    req.body = {
      page: options
    }.to_json
  end
  Pagiii.build_response(response)
end

.list(page = 1) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/pagiii_api/page.rb', line 15

def list(page = 1)
  conn = Pagiii.create_connection

  response = conn.get("/api/v1/admin/pages") do |req|
    req.params['page'] = page
  end

  Pagiii.build_response(response)
end