Class: DbAgent::Viewpoint::TypeCheck
- Inherits:
-
Object
- Object
- DbAgent::Viewpoint::TypeCheck
- Defined in:
- lib/db_agent/viewpoint/typecheck.rb
Overview
Forces typechecking on all child relations.
Instance Attribute Summary collapse
-
#child ⇒ Object
readonly
Returns the value of attribute child.
-
#db ⇒ Object
readonly
Returns the value of attribute db.
Instance Method Summary collapse
-
#initialize(db, child = nil) ⇒ TypeCheck
constructor
A new instance of TypeCheck.
- #method_missing(name, *args, &bl) ⇒ Object
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &bl) ⇒ Object
12 13 14 15 |
# File 'lib/db_agent/viewpoint/typecheck.rb', line 12 def method_missing(name, *args, &bl) return super unless args.empty? && bl.nil? child.send(name).with_typecheck end |
Instance Attribute Details
#child ⇒ Object (readonly)
Returns the value of attribute child.
10 11 12 |
# File 'lib/db_agent/viewpoint/typecheck.rb', line 10 def child @child end |
#db ⇒ Object (readonly)
Returns the value of attribute db.
10 11 12 |
# File 'lib/db_agent/viewpoint/typecheck.rb', line 10 def db @db end |