class Tixriss::Transformer::HTML

Public Instance Methods

body() click to toggle source
# File lib/tixriss/transformer.rb, line 32
      def body
        <<-EOBODY
<body>
<table class="table table-striped">
  <thead>
    <tr>
      <th>From</th>
      <th>To</th>
      <th>Text</th>
    </tr>
  </thead>
  <tbody>
    #{rows.join("\n")}
  </tbody>
</table>
</body>
EOBODY
      end
document() click to toggle source
# File lib/tixriss/transformer.rb, line 28
def document
  @document ||= Nokogiri::XML(xml)
end
header() click to toggle source
# File lib/tixriss/transformer.rb, line 51
      def header
        <<-EOHEADER
<html>
<head>
  <title>Tixriss Report</title>
  <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
</head>
EOHEADER
      end
rows() click to toggle source
# File lib/tixriss/transformer.rb, line 9
def rows
  links.map do |row|
    data = row.map { |cell| "<td>#{cell}</td>" }.join
    "<tr>#{data}</tr>"
  end
end
to_s() click to toggle source
# File lib/tixriss/transformer.rb, line 5
def to_s
  [header, body, footer].join "\n"
end