Module: Miguel::Schema::Output
- Included in:
- Column, ForeignKey, Index, Table
- Defined in:
- lib/miguel/schema.rb
Overview
Module for pretty printing of names, types, and especially options.
Instance Method Summary collapse
- #out_canonic_opts(prefix = ', ') ⇒ Object
- #out_columns ⇒ Object
- #out_default ⇒ Object
- #out_default_opts(prefix = ', ') ⇒ Object
- #out_name ⇒ Object
- #out_opts(prefix = ', ') ⇒ Object
- #out_table_name ⇒ Object
- #out_type ⇒ Object
Instance Method Details
#out_canonic_opts(prefix = ', ') ⇒ Object
47 48 49 |
# File 'lib/miguel/schema.rb', line 47 def out_canonic_opts( prefix = ', ' ) out_hash( canonic_opts, prefix ) end |
#out_columns ⇒ Object
63 64 65 |
# File 'lib/miguel/schema.rb', line 63 def out_columns columns.inspect end |
#out_default ⇒ Object
71 72 73 |
# File 'lib/miguel/schema.rb', line 71 def out_default out_value(default) end |
#out_default_opts(prefix = ', ') ⇒ Object
51 52 53 |
# File 'lib/miguel/schema.rb', line 51 def out_default_opts( prefix = ', ' ) out_hash( default_opts, prefix ) end |
#out_name ⇒ Object
55 56 57 |
# File 'lib/miguel/schema.rb', line 55 def out_name name.inspect end |
#out_opts(prefix = ', ') ⇒ Object
43 44 45 |
# File 'lib/miguel/schema.rb', line 43 def out_opts( prefix = ', ' ) out_hash( opts, prefix ) end |
#out_table_name ⇒ Object
67 68 69 |
# File 'lib/miguel/schema.rb', line 67 def out_table_name table_name.inspect end |
#out_type ⇒ Object
59 60 61 |
# File 'lib/miguel/schema.rb', line 59 def out_type type.to_s =~ /\A[A-Z]/ ? type.to_s : type.inspect end |