Class: YDB::Database

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

Constant Summary collapse

INTERNAL_VARS =
%i[@errors @schemas @source].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, schemas) ⇒ Database

Returns a new instance of Database.



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

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

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



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

def errors
  @errors
end

#schemasObject (readonly)

Returns the value of attribute schemas.



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

def schemas
  @schemas
end

#sourceObject (readonly)

Returns the value of attribute source.



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

def source
  @source
end

Instance Method Details

#buildObject



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

def build
  build_tables
  build_relationships
  check_relationships
  self
end