Class: Skmz::Schema

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
lib/skmz/schema.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tablesObject

Returns the value of attribute tables.



4
5
6
# File 'lib/skmz/schema.rb', line 4

def tables
  @tables
end

Class Method Details

.loadObject



7
8
9
10
11
12
13
# File 'lib/skmz/schema.rb', line 7

def load
  schema = Skmz::Schema.new(tables: [])
  table_names.each do |name|
    schema.tables << Skmz::Table.new(name: name)
  end
  schema
end

Instance Method Details

#as_jsonObject



23
24
25
# File 'lib/skmz/schema.rb', line 23

def as_json
  { tables: @tables.as_json }
end