Method: Mikon::Series#to_html

Defined in:
lib/mikon/core/series.rb

#to_html(threshold = 5) ⇒ Object



50
51
52
53
54
55
56
57
58
# File 'lib/mikon/core/series.rb', line 50

def to_html(threshold=5)
  html = "<table><tr><th></th><th>" + self.name.to_s + "</th></tr>"
  @index.each.with_index do |index, pos|
    next if pos > threshold && pos != self.length-1
    html += "<tr><th>" + index.to_s + "</th><td>" + @data[pos].to_s + "</td></tr>"
    html += "<tr><th>...</th><td>...</td></tr>" if pos == threshold
  end
  html + "</table>"
end