Class: ERDB::Utils
- Inherits:
-
Object
- Object
- ERDB::Utils
- Defined in:
- lib/erdb/utils.rb
Class Method Summary collapse
-
.display_output(data, provider) ⇒ void
Display the ER Diagram required data.
-
.is_mac? ⇒ Boolean
Check if the current OS is macOS.
-
.to_many_to_many(relations) ⇒ Array
Convert the relations to ER Diagram format.
Class Method Details
.display_output(data, provider) ⇒ void
This method returns an undefined value.
Display the ER Diagram required data.
10 11 12 13 14 15 |
# File 'lib/erdb/utils.rb', line 10 def display_output(data, provider) puts "### Copy following output to #{provider} if unexpected error happen ###" puts "### Start of output ###\n\n" puts data puts "\n### End of output ###" end |
.is_mac? ⇒ Boolean
Check if the current OS is macOS.
20 21 22 |
# File 'lib/erdb/utils.rb', line 20 def is_mac? RbConfig::CONFIG["host_os"] =~ /darwin|mac os/ end |
.to_many_to_many(relations) ⇒ Array
Convert the relations to ER Diagram format.
42 43 44 45 46 |
# File 'lib/erdb/utils.rb', line 42 def to_many_to_many(relations) relations.map do |relation| "#{relation[:to][:table]}.#{relation[:to][:column]}" end.uniq end |