Class: ConfluenceClient
- Inherits:
-
Object
- Object
- ConfluenceClient
- Defined in:
- lib/confluence.rb
Direct Known Subclasses
Instance Method Summary collapse
- #create_page_with_no_parent(title, spacekey, content) ⇒ Object
- #create_page_with_parent(title, spacekey, content, parentid) ⇒ Object
-
#initialize(url, name, password) ⇒ ConfluenceClient
constructor
A new instance of ConfluenceClient.
- #update_page_with_no_parent(page_obj, title, spacekey, content) ⇒ Object
- #update_page_with_parent(page_obj, title, parent_page_obj, spacekey, content) ⇒ Object
Constructor Details
#initialize(url, name, password) ⇒ ConfluenceClient
Returns a new instance of ConfluenceClient.
6 7 8 9 10 11 |
# File 'lib/confluence.rb', line 6 def initialize(url, name, password) @@conf_url = url @@login = name @@pwd = password @@urn = 'rest/api/content' end |
Instance Method Details
#create_page_with_no_parent(title, spacekey, content) ⇒ Object
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/confluence.rb', line 41 def create_page_with_no_parent(title, spacekey, content) = { type: 'create_page_with_no_parent', title: title, spacekey: spacekey, content: content } create_page(PagePayload.new().page_format) end |
#create_page_with_parent(title, spacekey, content, parentid) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/confluence.rb', line 13 def create_page_with_parent(title, spacekey, content, parentid) = { type: 'create_page_with_parent', title: title, spacekey: spacekey, content: content, parentid: parentid } create_page(PagePayload.new().page_format) end |
#update_page_with_no_parent(page_obj, title, spacekey, content) ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/confluence.rb', line 52 def update_page_with_no_parent(page_obj, title, spacekey, content) version = page_obj.version + 1 = { type: 'update_page_with_no_parent', pageid: page_obj.id, title: title, spacekey: spacekey, content: content, version: version } update_page(PagePayload.new().page_format, page_obj.id) end |
#update_page_with_parent(page_obj, title, parent_page_obj, spacekey, content) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/confluence.rb', line 25 def update_page_with_parent(page_obj, title, parent_page_obj, spacekey, content) version = page_obj.version + 1 = { type: 'update_page_with_parent', pageid: page_obj.id, parentid: parent_page_obj.id, title: title, spacekey: spacekey, content: content, version: version } update_page(PagePayload.new().page_format, page_obj.id) end |