Class: DbAgent::Viewpoint::Base
- Inherits:
-
Object
- Object
- DbAgent::Viewpoint::Base
- Defined in:
- lib/db_agent/viewpoint/base.rb
Overview
Factors relations on top of a Sequel database.
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Returns the value of attribute db.
Instance Method Summary collapse
-
#initialize(db) ⇒ Base
constructor
A new instance of Base.
- #method_missing(name, *args, &bl) ⇒ Object
Constructor Details
#initialize(db) ⇒ Base
Returns a new instance of Base.
6 7 8 |
# File 'lib/db_agent/viewpoint/base.rb', line 6 def initialize(db) @db = db end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &bl) ⇒ Object
11 12 13 14 |
# File 'lib/db_agent/viewpoint/base.rb', line 11 def method_missing(name, *args, &bl) return super unless args.empty? and bl.nil? Bmg.sequel(name, db) end |
Instance Attribute Details
#db ⇒ Object (readonly)
Returns the value of attribute db.
9 10 11 |
# File 'lib/db_agent/viewpoint/base.rb', line 9 def db @db end |