Class: Pgerd::Erd
- Inherits:
-
Object
- Object
- Pgerd::Erd
- Defined in:
- lib/pgerd/erd.rb,
lib/pgerd/erd/view_node.rb,
lib/pgerd/erd/table_node.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#diagram ⇒ Object
readonly
Returns the value of attribute diagram.
Instance Method Summary collapse
- #a4? ⇒ Boolean
-
#initialize(database, options = {}) ⇒ Erd
constructor
A new instance of Erd.
- #to_s ⇒ Object
Constructor Details
#initialize(database, options = {}) ⇒ Erd
Returns a new instance of Erd.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/pgerd/erd.rb', line 10 def initialize(database, = {}) @database = database @title = [:title] || @database.name @size = [:size].to_s.downcase @options = create_a_digraph draw_the_tables draw_the_views draw_the_foreign_keys end |
Instance Attribute Details
#diagram ⇒ Object (readonly)
Returns the value of attribute diagram.
8 9 10 |
# File 'lib/pgerd/erd.rb', line 8 def diagram @diagram end |
Instance Method Details
#a4? ⇒ Boolean
26 27 28 |
# File 'lib/pgerd/erd.rb', line 26 def a4? @size == 'a4' end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/pgerd/erd.rb', line 22 def to_s @diagram.output(dot: String) end |