Class: ConfluenceHelper::Confluence::DeliverablePage

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

Instance Method Summary collapse

Constructor Details

#initialize(labels:, body:) ⇒ DeliverablePage

Returns a new instance of DeliverablePage.



77
78
79
# File 'lib/confluence_helper.rb', line 77

def initialize(labels:, body:)
  @node = Nokogiri::HTML(body)
end

Instance Method Details

#deliverablesObject



85
86
87
# File 'lib/confluence_helper.rb', line 85

def deliverables
  tables.select{|t| is_deliverables_table? t } .map{|table| table.data }.flatten
end

#is_deliverables_table?(table) ⇒ Boolean

Name DHFR Status Location Comments

Returns:

  • (Boolean)


90
91
92
# File 'lib/confluence_helper.rb', line 90

def is_deliverables_table?(table)
  table.has_columns? columns: %w{Name DHFR Status Location Comments}
end

#tablesObject



81
82
83
# File 'lib/confluence_helper.rb', line 81

def tables
  @tables ||= @node.xpath('//table').map{|t| HtmlTable.new(t) }
end