Class: RomSqlGraph::Base
- Inherits:
-
Object
- Object
- RomSqlGraph::Base
- Defined in:
- lib/rom_sql_graph/base.rb
Instance Attribute Summary collapse
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Instance Method Summary collapse
- #edges ⇒ Object (also: #to_a)
- #generate_html ⇒ Object
- #generate_image ⇒ Object
-
#initialize(repo) ⇒ Base
constructor
A new instance of Base.
- #to_s ⇒ Object
Constructor Details
#initialize(repo) ⇒ Base
Returns a new instance of Base.
8 9 10 |
# File 'lib/rom_sql_graph/base.rb', line 8 def initialize(repo) @repo = repo end |
Instance Attribute Details
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
6 7 8 |
# File 'lib/rom_sql_graph/base.rb', line 6 def repo @repo end |
Instance Method Details
#edges ⇒ Object Also known as: to_a
12 13 14 |
# File 'lib/rom_sql_graph/base.rb', line 12 def edges Edges.new(repo).to_a end |
#generate_html ⇒ Object
21 22 23 |
# File 'lib/rom_sql_graph/base.rb', line 21 def generate_html HtmlGeneration.new(edges).call end |
#generate_image ⇒ Object
17 18 19 |
# File 'lib/rom_sql_graph/base.rb', line 17 def generate_image graph.write_to_graphic_file('jpg') end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/rom_sql_graph/base.rb', line 25 def to_s graph.edges.sort.to_s end |