Class: RomSqlGraph::HtmlGeneration
- Inherits:
-
Object
- Object
- RomSqlGraph::HtmlGeneration
- Defined in:
- lib/rom_sql_graph/html_generation.rb
Instance Attribute Summary collapse
-
#edges ⇒ Object
readonly
Returns the value of attribute edges.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(edges) ⇒ HtmlGeneration
constructor
A new instance of HtmlGeneration.
Constructor Details
#initialize(edges) ⇒ HtmlGeneration
Returns a new instance of HtmlGeneration.
7 8 9 |
# File 'lib/rom_sql_graph/html_generation.rb', line 7 def initialize(edges) @edges = edges end |
Instance Attribute Details
#edges ⇒ Object (readonly)
Returns the value of attribute edges.
5 6 7 |
# File 'lib/rom_sql_graph/html_generation.rb', line 5 def edges @edges end |
Instance Method Details
#call ⇒ Object
11 12 13 14 |
# File 'lib/rom_sql_graph/html_generation.rb', line 11 def call html = ERB.new(File.read("#{File.dirname(__FILE__)}/templates/graph.erb")).result binding File.open("#{Dir.pwd}/graph.html", 'w') { |file| file.write(html) } end |