Class: Schema2type::CovertService

Inherits:
Object
  • Object
show all
Defined in:
lib/schema2type/covert_service.rb

Defined Under Namespace

Modules: ActiveRecord

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(snake_case) ⇒ CovertService



3
4
5
6
# File 'lib/schema2type/covert_service.rb', line 3

def initialize(snake_case)
  @converted_types = []
  @snake_case = snake_case
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missingObject



18
19
20
# File 'lib/schema2type/covert_service.rb', line 18

def method_missing(*)
  # To exclude unnecessary methods
end

Class Method Details

.method_missingObject



22
23
24
# File 'lib/schema2type/covert_service.rb', line 22

def self.method_missing(*)
  # To exclude unnecessary methods
end

Instance Method Details

#create_table(table_name) {|converter| ... } ⇒ Object

Yields:

  • (converter)


12
13
14
15
16
# File 'lib/schema2type/covert_service.rb', line 12

def create_table(table_name, *)
  converter = SchemaConverter.new(table_name: table_name, snake_case: @snake_case)
  yield converter
  @converted_types.concat converter.result
end

#get_bindingObject



8
9
10
# File 'lib/schema2type/covert_service.rb', line 8

def get_binding
  binding
end