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

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_columnsObject



63
64
65
# File 'lib/miguel/schema.rb', line 63

def out_columns
  columns.inspect
end

#out_defaultObject



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_nameObject



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_nameObject



67
68
69
# File 'lib/miguel/schema.rb', line 67

def out_table_name
  table_name.inspect
end

#out_typeObject



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