Class: Confluence::Space
Overview
Constant Summary
collapse
- BOOKMARKS_PAGE_TITLE =
".bookmarks"
Instance Method Summary
collapse
Methods included from Findable
find
Methods inherited from Record
#[], #[]=, client, #client, client=, #initialize, #labels, #labels=, record_attr_accessor, #record_id, #to_hash
Instance Method Details
#blog_entries ⇒ Object
19
20
21
|
# File 'lib/confluence/space.rb', line 19
def blog_entries
client.getBlogEntries(self.key).collect {|summary| BlogEntry.new(client.getBlogEntry(summary["id"]))}
end
|
#bookmark_page ⇒ Object
11
12
13
|
# File 'lib/confluence/space.rb', line 11
def bookmark_page
@bookmark_page ||= Page.find :space => self.key, :title => BOOKMARKS_PAGE_TITLE
end
|
#bookmarks ⇒ Object
15
16
17
|
# File 'lib/confluence/space.rb', line 15
def bookmarks
@bookmarks ||= bookmark_page ? bookmark_page.children(Bookmark) : []
end
|
#find_page(args) ⇒ Object
23
24
25
26
27
|
# File 'lib/confluence/space.rb', line 23
def find_page(args)
if args.key? :title
Page.find :space => self.key, :title => args[:title]
end
end
|
#get_page(args) ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/confluence/space.rb', line 29
def get_page(args)
args[:parent_title] ||= "Home"
find_page(args) or begin
page = Confluence::Page.new :space => self.key, :title => args[:title]
if parent_page = find_page(:title => args[:parent_title])
page.parent_id = parent_page.page_id
end
page.store
end
end
|