Class: Hecks::Adapters::SQLDatabase::Schema
- Inherits:
-
Object
- Object
- Hecks::Adapters::SQLDatabase::Schema
- Defined in:
- lib/schema.rb
Instance Attribute Summary collapse
-
#tables ⇒ Object
readonly
Returns the value of attribute tables.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(tables) ⇒ Schema
constructor
A new instance of Schema.
- #to_h ⇒ Object
Constructor Details
#initialize(tables) ⇒ Schema
Returns a new instance of Schema.
15 16 17 |
# File 'lib/schema.rb', line 15 def initialize(tables) @tables = tables end |
Instance Attribute Details
#tables ⇒ Object (readonly)
Returns the value of attribute tables.
10 11 12 |
# File 'lib/schema.rb', line 10 def tables @tables end |
Class Method Details
.factory(domain_spec) ⇒ Object
11 12 13 |
# File 'lib/schema.rb', line 11 def self.factory(domain_spec) SchemaFactory.new(domain_spec).build end |
Instance Method Details
#to_h ⇒ Object
19 20 21 |
# File 'lib/schema.rb', line 19 def to_h tables.map { |table| [table.name.to_sym, table] }.to_h end |