Class: Minds::DatabaseConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/minds/datasources.rb

Direct Known Subclasses

Datasource

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, engine:, description:, connection_data: {}, tables: [], created_at: nil) ⇒ DatabaseConfig

Returns a new instance of DatabaseConfig.



5
6
7
8
9
10
11
12
# File 'lib/minds/datasources.rb', line 5

def initialize(name:, engine:, description:, connection_data: {}, tables: [], created_at: nil)
  @name = name
  @engine = engine
  @description = description
  @connection_data = connection_data
  @tables = tables
  @created_at = created_at
end

Instance Attribute Details

#connection_dataObject

Returns the value of attribute connection_data.



3
4
5
# File 'lib/minds/datasources.rb', line 3

def connection_data
  @connection_data
end

#created_atObject

Returns the value of attribute created_at.



3
4
5
# File 'lib/minds/datasources.rb', line 3

def created_at
  @created_at
end

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/minds/datasources.rb', line 3

def description
  @description
end

#engineObject

Returns the value of attribute engine.



3
4
5
# File 'lib/minds/datasources.rb', line 3

def engine
  @engine
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/minds/datasources.rb', line 3

def name
  @name
end

#tablesObject

Returns the value of attribute tables.



3
4
5
# File 'lib/minds/datasources.rb', line 3

def tables
  @tables
end

Instance Method Details

#to_hObject



14
15
16
17
18
19
20
21
22
# File 'lib/minds/datasources.rb', line 14

def to_h
  {
    name: @name,
    engine: @engine,
    description: @description,
    connection_data: @connection_data,
    tables: @tables
  }
end