Class: DbAgent::Viewpoint::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/db_agent/viewpoint/base.rb

Overview

Factors relations on top of a Sequel database.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dbObject (readonly)

Returns the value of attribute db.



9
10
11
# File 'lib/db_agent/viewpoint/base.rb', line 9

def db
  @db
end