Class: Osmer::Schema::Base
- Inherits:
-
Object
- Object
- Osmer::Schema::Base
- Includes:
- Configurable
- Defined in:
- lib/osmer/schema/base.rb
Defined Under Namespace
Classes: Dsl
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#ns ⇒ Object
readonly
Returns the value of attribute ns.
-
#projection ⇒ Object
Returns the value of attribute projection.
Instance Method Summary collapse
-
#attach_listener!(conn, collection, name, fields) ⇒ Object
Add collection listener name - stored procedure name.
-
#create!(db) ⇒ Object
Create schema in given database.
- #detach_listener!(conn, collection, name, fields) ⇒ Object
-
#drop!(db) ⇒ Object
Drop schema in given database.
-
#initialize(ns, name, options = {}) ⇒ Base
constructor
A new instance of Base.
- #recreate!(db) ⇒ Object
- #table_prefix ⇒ Object
Methods included from Configurable
Constructor Details
#initialize(ns, name, options = {}) ⇒ Base
Returns a new instance of Base.
10 11 12 13 14 15 16 17 18 |
# File 'lib/osmer/schema/base.rb', line 10 def initialize(ns, name, = {}) @ns = ns @name = name @projection = 4326 .each do |k,v| # Assign all schema options send "#{k}=", v end end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/osmer/schema/base.rb', line 7 def name @name end |
#ns ⇒ Object (readonly)
Returns the value of attribute ns.
7 8 9 |
# File 'lib/osmer/schema/base.rb', line 7 def ns @ns end |
#projection ⇒ Object
Returns the value of attribute projection.
8 9 10 |
# File 'lib/osmer/schema/base.rb', line 8 def projection @projection end |
Instance Method Details
#attach_listener!(conn, collection, name, fields) ⇒ Object
Add collection listener name - stored procedure name
38 39 40 |
# File 'lib/osmer/schema/base.rb', line 38 def attach_listener!(conn, collection, name, fields) raise StandardError.new("Not implemented") end |
#create!(db) ⇒ Object
Create schema in given database
21 22 23 |
# File 'lib/osmer/schema/base.rb', line 21 def create!(db) raise StandardError.new("Not implemented") end |
#detach_listener!(conn, collection, name, fields) ⇒ Object
42 43 44 |
# File 'lib/osmer/schema/base.rb', line 42 def detach_listener!(conn, collection, name, fields) raise StandardError.new("Not implemented") end |
#drop!(db) ⇒ Object
Drop schema in given database
26 27 28 |
# File 'lib/osmer/schema/base.rb', line 26 def drop!(db) raise StandardError.new("Not implemented") end |
#recreate!(db) ⇒ Object
30 31 32 33 |
# File 'lib/osmer/schema/base.rb', line 30 def recreate!(db) drop! db create! db end |
#table_prefix ⇒ Object
46 47 48 |
# File 'lib/osmer/schema/base.rb', line 46 def table_prefix [@ns.prefix, name].compact.join('_') end |