Class: Ar2gostruct::Converter

Inherits:
Object
  • Object
show all
Defined in:
lib/ar2gostruct/converter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, option = {}) ⇒ Converter

Returns a new instance of Converter.



3
4
5
6
7
8
9
10
# File 'lib/ar2gostruct/converter.rb', line 3

def initialize(klass, option = {})
  @klass = klass
  @max_col_size = 0
  @max_type_size = 0
  @plural = option[:plural]
  @orm = option[:orm]
  @association = option[:association]
end

Instance Attribute Details

#associationObject

Returns the value of attribute association.



11
12
13
# File 'lib/ar2gostruct/converter.rb', line 11

def association
  @association
end

#klassObject

Returns the value of attribute klass.



11
12
13
# File 'lib/ar2gostruct/converter.rb', line 11

def klass
  @klass
end

#max_col_sizeObject

Returns the value of attribute max_col_size.



11
12
13
# File 'lib/ar2gostruct/converter.rb', line 11

def max_col_size
  @max_col_size
end

#max_type_sizeObject

Returns the value of attribute max_type_size.



11
12
13
# File 'lib/ar2gostruct/converter.rb', line 11

def max_type_size
  @max_type_size
end

#ormObject

Returns the value of attribute orm.



11
12
13
# File 'lib/ar2gostruct/converter.rb', line 11

def orm
  @orm
end

#pluralObject

Returns the value of attribute plural.



11
12
13
# File 'lib/ar2gostruct/converter.rb', line 11

def plural
  @plural
end

Instance Method Details

#convert!Object



13
14
15
# File 'lib/ar2gostruct/converter.rb', line 13

def convert!
  get_schema_info
end