Class: Ribose::Wiki

Inherits:
Base
  • Object
show all
Includes:
Actions::All, Actions::Create, Actions::Delete, Actions::Fetch, Actions::Update
Defined in:
lib/ribose/wiki.rb

Class Method Summary collapse

Methods included from Actions::Delete

#delete

Methods included from Actions::Base

#included

Methods included from Actions::Update

#update

Methods included from Actions::Create

#create

Methods included from Actions::Fetch

#fetch

Methods included from Actions::All

#all

Methods inherited from Base

#initialize

Methods included from ResourceHelper

#resource_id, #resource_key, #resource_path, #resources

Constructor Details

This class inherits a constructor from Ribose::Base

Class Method Details

.all(space_id, options = {}) ⇒ Object

List wiki pages

Parameters:

  • space_id (String)

    The space UUID

  • options (Hash) (defaults to: {})

    Query parameters



15
16
17
# File 'lib/ribose/wiki.rb', line 15

def self.all(space_id, options = {})
  new(space_id: space_id, **options).all
end

.create(space_id, attributes) ⇒ Sawyer::Resoruce

Create a wiki page

Parameters:

  • space_id (String)

    The space UUID

  • attributes (Hash)

    Wiki page attributes

Returns:

  • (Sawyer::Resoruce)

    Newly created wiki



35
36
37
# File 'lib/ribose/wiki.rb', line 35

def self.create(space_id, attributes)
  new(space_id: space_id, **attributes).create
end

.delete(space_id, wiki_id, options = {}) ⇒ Object

Delete a wiki page

Parameters:

  • space_id (String)

    The space UUID

  • wiki_id (String)

    The wiki-page UUID



56
57
58
# File 'lib/ribose/wiki.rb', line 56

def self.delete(space_id, wiki_id, options = {})
  new(space_id: space_id, resource_id: wiki_id, **options).delete
end

.fetch(space_id, wiki_id, options = {}) ⇒ Sawyer::Resoruce

Fetch a wiki page

Parameters:

  • space_id (String)

    The space UUID

  • wiki_id (String)

    The Wiki UUID

Returns:

  • (Sawyer::Resoruce)


25
26
27
# File 'lib/ribose/wiki.rb', line 25

def self.fetch(space_id, wiki_id, options = {})
  new(space_id: space_id, resource_id: wiki_id, **options).fetch
end

.update(space_id, wiki_id, attributes) ⇒ Sawyer::Resoruce

Update a wiki page

Parameters:

  • space_id (String)

    The space UUID

  • wiki_id (String)

    The wiki-page UUID

  • attributes (Hash)

    Wiki page attributes

Returns:

  • (Sawyer::Resoruce)

    Updated wiki page



47
48
49
# File 'lib/ribose/wiki.rb', line 47

def self.update(space_id, wiki_id, attributes)
  new(space_id: space_id, resource_id: wiki_id, **attributes).update
end