Class: YDB::Database

Inherits:
Object
  • Object
show all
Defined in:
lib/yaml-file-db/database.rb

Constant Summary collapse

INTERNAL_VARS =
[:@errors, :@schemas, :@source].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, schemas) ⇒ Database

Returns a new instance of Database.



8
9
10
11
12
# File 'lib/yaml-file-db/database.rb', line 8

def initialize(source, schemas)
  @errors = []
  @schemas = schemas
  @source = source
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



6
7
8
# File 'lib/yaml-file-db/database.rb', line 6

def errors
  @errors
end

#schemasObject (readonly)

Returns the value of attribute schemas.



6
7
8
# File 'lib/yaml-file-db/database.rb', line 6

def schemas
  @schemas
end

#sourceObject (readonly)

Returns the value of attribute source.



6
7
8
# File 'lib/yaml-file-db/database.rb', line 6

def source
  @source
end

Instance Method Details

#buildObject



14
15
16
17
18
19
# File 'lib/yaml-file-db/database.rb', line 14

def build()
  build_tables()
  build_relationships()
  check_relationships()
  self
end