Class: BinPacking::Export
- Inherits:
-
Object
- Object
- BinPacking::Export
- Defined in:
- lib/bin_packing/export.rb
Instance Method Summary collapse
-
#initialize(*bins) ⇒ Export
constructor
A new instance of Export.
- #to_html(options = {}) ⇒ Object
Constructor Details
#initialize(*bins) ⇒ Export
Returns a new instance of Export.
3 4 5 |
# File 'lib/bin_packing/export.rb', line 3 def initialize(*bins) @bins = Array(bins).flatten end |
Instance Method Details
#to_html(options = {}) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/bin_packing/export.rb', line 7 def to_html( = {}) template_path = File.('../resources/export.html.erb', __FILE__) template = File.read(template_path) binding = ExportBinding.new(@bins, [:zoom] || 1) html = ERB.new(template).result(binding.get_binding) html end |