Class: RowHTML
- Defined in:
- lib/html_compilation/classes/builders/row_html.rb
Instance Attribute Summary
Attributes inherited from HTML
Instance Method Summary collapse
Methods inherited from HTML
Methods included from YAMLInteraction
Constructor Details
This class inherits a constructor from HTML
Instance Method Details
#build ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/html_compilation/classes/builders/row_html.rb', line 2 def build self.send("data_location=", File.("../../../data/html_data/row_data.yaml", __FILE__)) row = read_yaml(data_location, "TR") data_cell = read_yaml(data_location, "TD") cells = object.values.map do |key| data_cell.gsub("sample", (htmlify(object.send(key)).to_s)) end cells.push(data_cell.gsub("sample", htmlify(object.instances.to_i.to_s))) row.gsub("sample", cells.join.to_s) end |