Module: DB::Model::Schema

Defined in:
lib/db/model/schema.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cacheObject (readonly)

Returns the value of attribute cache.



35
36
37
# File 'lib/db/model/schema.rb', line 35

def cache
  @cache
end

#contextObject (readonly)

Returns the value of attribute context.



34
35
36
# File 'lib/db/model/schema.rb', line 34

def context
  @context
end

Instance Method Details

#initialize(context, cache: Cache.new) ⇒ Object



29
30
31
32
# File 'lib/db/model/schema.rb', line 29

def initialize(context, cache: Cache.new)
	@context = context
	@cache = cache
end

#inspectObject



41
42
43
# File 'lib/db/model/schema.rb', line 41

def inspect
	"\#<#{self.class} #{@context.class} cache=#{@cache}>"
end

#table(model) ⇒ Object



37
38
39
# File 'lib/db/model/schema.rb', line 37

def table(model)
	Table.new(@context, model, @cache)
end