Class: ConfluenceHelper::WikiPage

Inherits:
Confluence show all
Defined in:
lib/confluence_helper.rb

Instance Method Summary collapse

Methods inherited from Confluence

#deliverables_pages, #find_url_by_title_and_space, #get_labels_for_each_child_page, #save_page_attachment

Constructor Details

#initialize(spacekey, title) ⇒ WikiPage

Returns a new instance of WikiPage.



168
169
170
# File 'lib/confluence_helper.rb', line 168

def initialize(spacekey, title)
  @spacekey, @title = spacekey, title
end

Instance Method Details

#attachment(title) ⇒ Object



176
177
178
179
180
181
182
# File 'lib/confluence_helper.rb', line 176

def attachment(title)
  page = query_rest_api( url , {expand:"children.attachment"})
  results = page.body["children"]["attachment"]["results"]
  result = results.find{|x| x["title"] == title}
  attachment_url = "#{ENVied.CONSTASH_URL}#{result["_links"]["download"]}"
  query_rest_api(attachment_url, options = {}).body
end

#to_nodes(mode = :text) ⇒ Object



172
173
174
# File 'lib/confluence_helper.rb', line 172

def to_nodes(mode=:text)
  parse_wiki_table(doc, mode)
end