Module: DB::Model::Schema
- Defined in:
- lib/db/model/schema.rb
Instance Attribute Summary collapse
-
#cache ⇒ Object
readonly
Returns the value of attribute cache.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
Instance Attribute Details
#cache ⇒ Object (readonly)
Returns the value of attribute cache.
18 19 20 |
# File 'lib/db/model/schema.rb', line 18 def cache @cache end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
17 18 19 |
# File 'lib/db/model/schema.rb', line 17 def context @context end |
Instance Method Details
#initialize(context, cache: Cache.new) ⇒ Object
12 13 14 15 |
# File 'lib/db/model/schema.rb', line 12 def initialize(context, cache: Cache.new) @context = context @cache = cache end |
#inspect ⇒ Object
24 25 26 |
# File 'lib/db/model/schema.rb', line 24 def inspect "\#<#{self.class} #{@context.class} cache=#{@cache}>" end |
#table(model) ⇒ Object
20 21 22 |
# File 'lib/db/model/schema.rb', line 20 def table(model) Table.new(@context, model, @cache) end |